summaryrefslogtreecommitdiff
path: root/protocols/SkypeClassic/src/skype.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-01-19 11:24:00 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-01-19 11:24:00 +0000
commit845524fa5156dff2bf0b8ab1590c42293b64ad8b (patch)
tree6fa7e606e6b15c0a8a93d65999725af0ee8fecdd /protocols/SkypeClassic/src/skype.cpp
parent15877bd0e2177fe045e9a7097a7b836053b1a491 (diff)
SkypeClassic:
-Fixed "NoAck" option (from leecher's repo) git-svn-id: http://svn.miranda-ng.org/main/trunk@11877 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeClassic/src/skype.cpp')
-rw-r--r--protocols/SkypeClassic/src/skype.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp
index c9280b616f..cc72190567 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -2646,13 +2646,20 @@ static INT_PTR EventAddHook(WPARAM wParam, LPARAM lParam)
#endif
void MessageSendWatchThread(void *a) {
- char *err, *ptr, *nexttoken;
+ char *str, *err, *ptr, *nexttoken;
HANDLE hDBAddEvent = NULL;
msgsendwt_arg *arg = (msgsendwt_arg*)a;
LOG(("MessageSendWatchThread started."));
- char *str = SkypeRcvMsg(arg->szId, SkypeTime(NULL) - 1, arg->hContact, db_get_dw(NULL, "SRMsg", "MessageTimeout", TIMEOUT_MSGSEND));
+ if (db_get_b(NULL, SKYPE_PROTONAME, "NoAck", 1))
+ {
+ ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ str=NULL;
+ }
+ else
+ str = SkypeRcvMsg(arg->szId, SkypeTime(NULL) - 1, arg->hContact, db_get_dw(NULL, "SRMsg", "MessageTimeout", TIMEOUT_MSGSEND));
+
InterlockedDecrement(&sendwatchers);
if (str)
{
@@ -2731,27 +2738,22 @@ INT_PTR SkypeSendMessage(WPARAM, LPARAM lParam) {
sprintf(szId, "#M%d ", dwMsgNum++);
}
InterlockedIncrement(&sendwatchers);
- BOOL sendok = true;
+ bool sendok = true;
if (!utfmsg || SkypeSend("%s%s %s %s", szId, mymsgcmd, dbv.pszVal, utfmsg))
sendok = false;
if (utfmsg && utfmsg != msg) free(utfmsg);
db_free(&dbv);
if (sendok) {
- if (db_get_b(NULL, SKYPE_PROTONAME, "NoAck", 1)) {
- ProtoBroadcastAck(SKYPE_PROTONAME, ccs->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0);
- }
- else {
- msgsendwt_arg *psendarg = (msgsendwt_arg*)calloc(1, sizeof(msgsendwt_arg));
+ msgsendwt_arg *psendarg = (msgsendwt_arg*)calloc(1, sizeof(msgsendwt_arg));
- if (psendarg) {
- psendarg->hContact = ccs->hContact;
- strcpy(psendarg->szId, szId);
- pthread_create(MessageSendWatchThread, psendarg);
- return 1;
- }
+ if (psendarg) {
+ psendarg->hContact = ccs->hContact;
+ strcpy(psendarg->szId, szId);
+ pthread_create(MessageSendWatchThread, psendarg);
}
- InterlockedDecrement(&sendwatchers);
+ else
+ InterlockedDecrement(&sendwatchers);
return 1;
}
else