diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-24 11:35:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-24 11:35:29 +0300 |
commit | 6461368c27087631355bd024a5a899cee6b2c623 (patch) | |
tree | 6bfd5993079a8e3122ad324a9b6c3159665b6b78 /protocols/ICQ-WIM | |
parent | 6cd98af71aaba31ac85c65a966cd672016a023ef (diff) |
ICQ-WIM: auth request support
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 8 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 16 |
3 files changed, 25 insertions, 0 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index d67a5204ca..6fbac6f3ab 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -389,6 +389,14 @@ MCONTACT CIcqProto::AddToList(int, PROTOSEARCHRESULT *psr) } //////////////////////////////////////////////////////////////////////////////////////// +// PSR_AUTH + +int CIcqProto::AuthRecv(MCONTACT, PROTORECVEVENT *pre) +{ + return Proto_AuthRecv(m_szModuleName, pre); +} + +//////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST int CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage) diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 2a4436fb39..47e8cba068 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -405,6 +405,7 @@ class CIcqProto : public PROTO<CIcqProto> MCONTACT AddToList( int flags, PROTOSEARCHRESULT *psr) override; + int AuthRecv(MCONTACT, PROTORECVEVENT *pre) override; int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override; INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index f9442cabcc..1092dba581 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -388,6 +388,22 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo else { wszText = it["text"].as_mstring(); wszText.TrimRight(); + + // user added you + if (it["class"].as_mstring() == L"event" && it["eventTypeId"].as_mstring() == L"27:33000") { + CMStringA id = getMStringA(hContact, DB_KEY_ID); + int pos = id.Find('@'); + CMStringA nick = (pos == -1) ? id : id.Left(pos); + + DB::AUTH_BLOB blob(hContact, nick, nullptr, nullptr, id, nullptr); + + PROTORECVEVENT pre = {}; + pre.timestamp = (DWORD)time(0); + pre.lParam = blob.size(); + pre.szMessage = blob; + ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre); + return; + } } int iMsgTime = (bLocalTime) ? time(0) : it["time"].as_int(); |