diff options
author | George Hazan <ghazan@miranda.im> | 2021-08-06 21:15:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-08-06 21:15:36 +0300 |
commit | ef7ba795a1a2be36522c67a06822fbe3ec972782 (patch) | |
tree | 9170c4f8e55f4ed8f761132c8bcb218e7eff73d6 /protocols/ICQ-WIM/src | |
parent | dcaca323eab03e590bcd483af597c22c1c769a1a (diff) |
fixes #2940 (ICQ: при активной сессии Миранда не видит, что контакт вошёл в сеть)
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r-- | protocols/ICQ-WIM/src/poll.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 11 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/version.h | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp index b6bd58760d..bbf0792cc9 100644 --- a/protocols/ICQ-WIM/src/poll.cpp +++ b/protocols/ICQ-WIM/src/poll.cpp @@ -336,7 +336,7 @@ void CIcqProto::ProcessPresence(const JSONNode &ev) // if a client returns back online, we clear timers not to play with statuses anymore else pCache->m_timer1 = pCache->m_timer2 = 0; - setDword(pCache->m_hContact, "Status", iNewStatus); + setWord(pCache->m_hContact, "Status", iNewStatus); Json2string(pCache->m_hContact, ev, "friendly", "Nick"); CheckAvatarChange(pCache->m_hContact, ev); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index c650fc2224..5e08e895e7 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -171,18 +171,18 @@ void CIcqProto::CheckStatus() // if the second timer is set up, activate it if (m_iTimeDiff2) { - setDword(it->m_hContact, "Status", m_iStatus2); + setWord(it->m_hContact, "Status", m_iStatus2); it->m_timer2 = now; } // if the second timer is not set, simply mark a contact as offline - else setDword(it->m_hContact, "Status", ID_STATUS_OFFLINE); + else setWord(it->m_hContact, "Status", ID_STATUS_OFFLINE); continue; } // if the second timer is expired, set status to offline if (diff2 && it->m_timer2 && now - it->m_timer2 > m_iTimeDiff2) { it->m_timer2 = 0; - setDword(it->m_hContact, "Status", ID_STATUS_OFFLINE); + setWord(it->m_hContact, "Status", ID_STATUS_OFFLINE); } } } @@ -349,7 +349,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) else delSetting(hContact, "MirVer"); CMStringW str(buddy["state"].as_mstring()); - setDword(hContact, "Status", StatusFromString(str)); + WORD wStatus = StatusFromString(str); const JSONNode &var = buddy["friendly"]; if (var) @@ -368,6 +368,9 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) // zero here means that a contact is currently online int lastSeen = buddy["lastseen"].as_int(); setDword(hContact, DB_KEY_LASTSEEN, lastSeen ? lastSeen : time(0)); + if (lastSeen == 0) + wStatus = ID_STATUS_ONLINE; + setDword(hContact, "Status", wStatus); Json2int(hContact, buddy, "official", "Official"); Json2int(hContact, buddy, "onlineTime", DB_KEY_ONLINETS); diff --git a/protocols/ICQ-WIM/src/version.h b/protocols/ICQ-WIM/src/version.h index a8e270e799..77882b494a 100644 --- a/protocols/ICQ-WIM/src/version.h +++ b/protocols/ICQ-WIM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 96 #define __RELEASE_NUM 1 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #include <stdver.h> |