From d1de0e3cba9195d28126e102679d6ed1a7f72d0c Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 14 Nov 2015 14:44:56 +0000 Subject: Tlen: - Fix for GetContactDisplayName git-svn-id: http://svn.miranda-ng.org/main/trunk@15722 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_file.cpp | 10 ++++++---- protocols/Tlen/src/tlen_svc.cpp | 2 +- protocols/Tlen/src/tlen_voice.cpp | 18 ++++++++++-------- protocols/Tlen/src/tlen_voice.h | 3 --- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index 49f62d50e9..d43ff1d153 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -172,8 +172,9 @@ static void TlenFileReceivingConnection(HANDLE hConnection, DWORD, void * pExtra else Netlib_CloseHandle(hConnection); } -static void __cdecl TlenFileReceiveThread(TLEN_FILE_TRANSFER *ft) +static void __cdecl TlenFileReceiveThread(void *arg) { + TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)arg; ft->proto->debugLogA("Thread started: type=file_receive server='%s' port='%d'", ft->hostName, ft->wPort); ft->mode = FT_RECV; @@ -441,8 +442,9 @@ int TlenFileCancelAll(TlenProtocol *proto) return 0; } -static void __cdecl TlenFileSendingThread(TLEN_FILE_TRANSFER *ft) +static void __cdecl TlenFileSendingThread(void *arg) { + TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)arg; char *nick; ft->proto->debugLogA("Thread started: type=tlen_file_send"); @@ -630,7 +632,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) if ((p = TlenXmlGetAttrValue(node, "i")) != NULL) if ((item = TlenListGetItemPtr(info->proto, LIST_FILE, p)) != NULL) if (!mir_strcmp(item->ft->jid, jid)) - mir_forkthread((pThreadFunc)TlenFileSendingThread, item->ft); + mir_forkthread(TlenFileSendingThread, item->ft); } else if (!mir_strcmp(e, "6")) { // FILE_RECV : e='6' : IP and port information to connect to get file @@ -640,7 +642,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) item->ft->hostName = mir_strdup(p); if ((p = TlenXmlGetAttrValue(node, "p")) != NULL) { item->ft->wPort = atoi(p); - mir_forkthread((pThreadFunc)TlenFileReceiveThread, item->ft); + mir_forkthread(TlenFileReceiveThread, item->ft); } } } diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 5a367388f1..ab0cb4324c 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -926,7 +926,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) jid = dbv.pszVal; if ((item = TlenListGetItemPtr(this, LIST_ROSTER, dbv.pszVal)) != NULL) { if (cws->value.type == DBVT_DELETED) { - newNick = mir_strdup((char *)pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE)); + newNick = mir_t2a(pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE)); } else if (cws->value.pszVal != NULL) { newNick = settingToChar(cws); diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index f35a51d4fa..5548662415 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -172,7 +172,7 @@ static int TlenVoiceRecordingStart(TLEN_VOICE_CONTROL *control) control->waveHeadersPos = 0; control->waveHeadersNum = 2; - control->hThread = mir_forkthread(TlenVoiceRecordingThreadProc, (void*)control); + control->hThread = mir_forkthread(TlenVoiceRecordingThreadProc, control); SetThreadPriority(control->hThread, THREAD_PRIORITY_ABOVE_NORMAL); @@ -287,8 +287,9 @@ static void TlenVoiceCrypt(char *buffer, int len) } } -void __cdecl TlenVoiceReceiveThread(TLEN_FILE_TRANSFER *ft) +static void __cdecl TlenVoiceReceiveThread(void *arg) { + TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)arg; ft->proto->debugLogA("Thread started: type=file_receive server='%s' port='%d'", ft->hostName, ft->wPort); NETLIBOPENCONNECTION nloc = { sizeof(nloc) }; @@ -508,8 +509,9 @@ static void TlenVoiceReceiveParse(TLEN_FILE_TRANSFER *ft) } -void __cdecl TlenVoiceSendingThread(TLEN_FILE_TRANSFER *ft) +static void __cdecl TlenVoiceSendingThread(void *arg) { + TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)arg; char *nick; ft->proto->debugLogA("Thread started: type=voice_send"); @@ -914,13 +916,13 @@ int TlenVoiceStart(TLEN_FILE_TRANSFER *ft, int mode) ft->proto->debugLogA("starting voice %d", mode); if (mode == 0) { - mir_forkthread((pThreadFunc)TlenVoiceReceiveThread, ft); + mir_forkthread(TlenVoiceReceiveThread, ft); } else if (mode == 1) { - mir_forkthread((pThreadFunc)TlenVoiceSendingThread, ft); + mir_forkthread(TlenVoiceSendingThread, ft); } else { - mir_forkthread((pThreadFunc)TlenVoiceDlgThread, ft); + mir_forkthread(TlenVoiceDlgThread, ft); } return 0; } @@ -934,7 +936,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) mir_snprintf(jid, "%s@%s", id, dbv.pszVal); db_free(&dbv); if ((hContact = TlenHContactFromJID(proto, jid)) != NULL) - return mir_strdup((char *)pcli->pfnGetContactDisplayName(hContact, 0)); + return mir_t2a(pcli->pfnGetContactDisplayName(hContact, 0)); } return mir_strdup(id); } @@ -1050,7 +1052,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) ACCEPTDIALOGDATA *data = (ACCEPTDIALOGDATA *)mir_alloc(sizeof(ACCEPTDIALOGDATA)); data->proto = proto; data->item = item; - mir_forkthread((pThreadFunc)TlenVoiceAcceptDlgThread, data); + mir_forkthread(TlenVoiceAcceptDlgThread, data); } else if (proto->isOnline) { item->ft = TlenFileCreateFT(proto, from); diff --git a/protocols/Tlen/src/tlen_voice.h b/protocols/Tlen/src/tlen_voice.h index bc1adf6364..daaa13eda4 100644 --- a/protocols/Tlen/src/tlen_voice.h +++ b/protocols/Tlen/src/tlen_voice.h @@ -57,9 +57,6 @@ typedef struct TLEN_VOICE_CONTROL_STRUCT { } TLEN_VOICE_CONTROL; -void __cdecl TlenVoiceSendingThread(TLEN_FILE_TRANSFER *ft); -void __cdecl TlenVoiceReceiveThread(TLEN_FILE_TRANSFER *ft); - int TlenVoiceStart(TLEN_FILE_TRANSFER *ft, int mode) ; int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from); int TlenVoiceIsInUse(TlenProtocol *proto); -- cgit v1.2.3