diff options
Diffstat (limited to 'protocols/Sametime/src')
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 37 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.h | 4 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.cpp | 23 |
3 files changed, 4 insertions, 60 deletions
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 189e877a66..186ebcda7f 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -87,43 +87,8 @@ void SametimeInitIcons(void) }
// Copied from MSN plugin - sent acks need to be from different thread
-void __cdecl sttFakeAckInfoSuccessThread(TFakeAckParams* tParam)
-{
- CSametimeProto* proto = tParam->proto;
- proto->debugLogW(L"sttFakeAckInfoSuccessThread() start");
-
- Sleep(100);
- proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1);
-
- proto->debugLogW(L"sttFakeAckInfoSuccessThread() end");
- mir_free(tParam);
-}
-
-void __cdecl sttFakeAckMessageSuccessThread(TFakeAckParams* tParam)
-{
- CSametimeProto* proto = tParam->proto;
- proto->debugLogW(L"sttFakeAckMessageSuccessThread() start");
-
- Sleep(100);
- proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)tParam->lParam, 0);
-
- proto->debugLogW(L"sttFakeAckMessageSuccessThread() end");
- mir_free(tParam);
-}
-
-void __cdecl sttFakeAckMessageFailedThread(TFakeAckParams* tParam)
-{
- CSametimeProto* proto = tParam->proto;
- proto->debugLogW(L"sttFakeAckMessageFailedThread() start");
-
- Sleep(100);
- proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, tParam->lParam); ///TODO tParam->lParam: add error message
-
- proto->debugLogW(L"sttFakeAckMessageFailedThread() end");
- mir_free(tParam);
-}
-void __cdecl sttRecvAwayThread(TFakeAckParams* tParam)
+void __cdecl sttRecvAwayThread(TFakeAckParams *tParam)
{
CSametimeProto* proto = tParam->proto;
proto->debugLogW(L"sttRecvAwayThread() start");
diff --git a/protocols/Sametime/src/sametime.h b/protocols/Sametime/src/sametime.h index 2714779be2..e553b3bd33 100644 --- a/protocols/Sametime/src/sametime.h +++ b/protocols/Sametime/src/sametime.h @@ -50,12 +50,8 @@ struct TFakeAckParams LPARAM lParam;
};
-void __cdecl sttFakeAckInfoSuccessThread(TFakeAckParams* tParam);
-void __cdecl sttFakeAckMessageFailedThread(TFakeAckParams* tParam);
-void __cdecl sttFakeAckMessageSuccessThread(TFakeAckParams* tParam);
void __cdecl sttRecvAwayThread(TFakeAckParams* tParam);
-
//sametime structs
typedef struct Options_tag {
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 37b158cb1a..7f583c3e1d 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -131,14 +131,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType) if (!session)
return 1;
- ///TODO unimplemented - getting contact info
-
- TFakeAckParams* tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams));
- tfap->proto = this;
- tfap->hContact = hContact;
- tfap->lParam = NULL;
- mir_forkThread<TFakeAckParams>(sttFakeAckInfoSuccessThread, tfap);
-
+ ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, 0);
return 0;
}
@@ -205,11 +198,7 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg) char *proto = Proto_GetBaseAccountName(hContact);
if (!proto || mir_strcmp(proto, m_szModuleName) != 0 || db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) {
- TFakeAckParams* tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams));
- tfap->proto = this;
- tfap->hContact = hContact;
- tfap->lParam = 0;
- mir_forkThread<TFakeAckParams>(sttFakeAckMessageFailedThread, tfap);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, 0);
return 0;
}
@@ -217,13 +206,7 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg) return 0;
int ret = (INT_PTR)SendMessageToUser(hContact, msg);
-
- TFakeAckParams *tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams));
- tfap->proto = this;
- tfap->hContact = hContact;
- tfap->lParam = (LPARAM)ret;
- mir_forkThread<TFakeAckParams>(sttFakeAckMessageSuccessThread, tfap);
-
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)ret);
return ret;
}
|