summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-01-06 11:19:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-01-06 11:19:33 +0000
commita0c93d2ab7d8473cdbb62f939d92dbb4613e0780 (patch)
tree53e771b9a8adb99ac7236bdbee7c286a40b6782a /protocols
parent84846bd0e3626802e6fd28119d9ec6617253e9fa (diff)
fix for receiving messages in YAHOO
git-svn-id: http://svn.miranda-ng.org/main/trunk@2991 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Yahoo/src/im.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp
index 52d21112ae..9f5e94bf9e 100644
--- a/protocols/Yahoo/src/im.cpp
+++ b/protocols/Yahoo/src/im.cpp
@@ -34,9 +34,6 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
char *umsg;
const char *c = msg;
int oidx = 0;
- PROTORECVEVENT pre;
- HANDLE hContact = NULL;
-
LOG(("YAHOO_GOT_IM id:%s %s: %s (len: %d) tm:%lu stat:%i utf8:%i buddy_icon: %i", me, who, msg, lstrlenA(msg), tm, stat, utf8, buddy_icon));
@@ -103,19 +100,19 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
/* Need to strip off formatting stuff first. Then do all decoding/converting */
LOG(("%s: %s", who, umsg));
+ HANDLE hContact = add_buddy(who, who, protocol, PALF_TEMPORARY);
//SetWord(hContact, "yprotoid", protocol);
Set_Protocol(hContact, protocol);
+ PROTORECVEVENT pre;
pre.flags = (utf8) ? PREF_UTF : 0;
if (tm) {
HANDLE hEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0);
if (hEvent) { // contact has events
- DBEVENTINFO dbei;
DWORD dummy;
-
- dbei.cbSize = sizeof (DBEVENTINFO);
+ DBEVENTINFO dbei = { sizeof (dbei) };
dbei.pBlob = (BYTE*)&dummy;
dbei.cbBlob = 2;
if (!CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&dbei))
@@ -128,8 +125,8 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons
if ((DWORD)tm < pre.timestamp)
pre.timestamp = tm;
- } else
- pre.timestamp = (DWORD)time(NULL);
+ }
+ else pre.timestamp = (DWORD)time(NULL);
pre.szMessage = umsg;
pre.lParam = 0;