diff options
-rw-r--r-- | protocols/Tox/Tox_10.vcxproj | 1 | ||||
-rw-r--r-- | protocols/Tox/Tox_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/Tox/Tox_12.vcxproj | 1 | ||||
-rw-r--r-- | protocols/Tox/Tox_12.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_svc.cpp | 10 |
7 files changed, 22 insertions, 0 deletions
diff --git a/protocols/Tox/Tox_10.vcxproj b/protocols/Tox/Tox_10.vcxproj index 49b2470d88..9712e4b8e0 100644 --- a/protocols/Tox/Tox_10.vcxproj +++ b/protocols/Tox/Tox_10.vcxproj @@ -229,6 +229,7 @@ <ClCompile Include="src\tox_proto.cpp" />
<ClCompile Include="src\tox_search.cpp" />
<ClCompile Include="src\tox_contacts.cpp" />
+ <ClCompile Include="src\tox_svc.cpp" />
<ClCompile Include="src\tox_transfer.cpp" />
<ClCompile Include="src\tox_utils.cpp" />
</ItemGroup>
diff --git a/protocols/Tox/Tox_10.vcxproj.filters b/protocols/Tox/Tox_10.vcxproj.filters index 605ba7bc4f..ae06a521d6 100644 --- a/protocols/Tox/Tox_10.vcxproj.filters +++ b/protocols/Tox/Tox_10.vcxproj.filters @@ -122,6 +122,9 @@ <ClCompile Include="src\tox_core.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\tox_svc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
diff --git a/protocols/Tox/Tox_12.vcxproj b/protocols/Tox/Tox_12.vcxproj index 1c97ba2148..924717bba1 100644 --- a/protocols/Tox/Tox_12.vcxproj +++ b/protocols/Tox/Tox_12.vcxproj @@ -232,6 +232,7 @@ <ClCompile Include="src\tox_proto.cpp" />
<ClCompile Include="src\tox_search.cpp" />
<ClCompile Include="src\tox_contacts.cpp" />
+ <ClCompile Include="src\tox_svc.cpp" />
<ClCompile Include="src\tox_transfer.cpp" />
<ClCompile Include="src\tox_utils.cpp" />
</ItemGroup>
diff --git a/protocols/Tox/Tox_12.vcxproj.filters b/protocols/Tox/Tox_12.vcxproj.filters index 605ba7bc4f..ae06a521d6 100644 --- a/protocols/Tox/Tox_12.vcxproj.filters +++ b/protocols/Tox/Tox_12.vcxproj.filters @@ -122,6 +122,9 @@ <ClCompile Include="src\tox_core.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\tox_svc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 8dfa281296..5da0686a7a 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -46,6 +46,8 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) : CreateProtoService(PS_GETMYAVATART, &CToxProto::GetMyAvatar);
CreateProtoService(PS_SETMYAVATART, &CToxProto::SetMyAvatar);
+ CreateProtoService(PS_SETMYNICKNAME, &CToxProto::SetMyNickname);
+
// transfers
transfers = new CTransferList();
}
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 2de83cdd38..ecfcc94b50 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -169,6 +169,8 @@ private: INT_PTR __cdecl GetMyAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SetMyAvatar(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam);
+
static void OnGotFriendAvatarInfo(Tox *tox, int32_t number, uint8_t format, uint8_t *hash, void *arg);
static void OnGotFriendAvatarData(Tox *tox, int32_t number, uint8_t format, uint8_t *hash, uint8_t *data, uint32_t length, void *arg);
diff --git a/protocols/Tox/src/tox_svc.cpp b/protocols/Tox/src/tox_svc.cpp new file mode 100644 index 0000000000..83ea092f36 --- /dev/null +++ b/protocols/Tox/src/tox_svc.cpp @@ -0,0 +1,10 @@ +#include "common.h"
+
+INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
+{
+ TCHAR *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR*)lParam) : mir_a2t((char*)lParam);
+
+ setTString("Nick", nickname);
+ tox_set_name(tox, (uint8_t*)(char*)_T2A(nickname), mir_tstrlen(nickname));
+ return 0;
+}
|