From caaaf9ffe9ac3c28f2e9459ac4afb34fcd59f72d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Nov 2023 15:16:50 +0300 Subject: =?UTF-8?q?fixes=20#3790=20(Jabber:=20=D0=B7=D0=B0=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=81=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/JabberG/src/jabber_proto.cpp | 41 +++++++++++++++++++++------------- protocols/JabberG/src/jabber_proto.h | 1 + 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index f9b1ba6cdf..03a1ce8aa3 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -356,7 +356,7 @@ void CJabberProto::OnShutdown() } //////////////////////////////////////////////////////////////////////////////////////// -// JabberAddToList - adds a contact to the contact list +// AddToList - adds a contact to the contact list MCONTACT CJabberProto::AddToListByJID(const char *newJid, uint32_t flags) { @@ -394,7 +394,7 @@ MCONTACT CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbE } //////////////////////////////////////////////////////////////////////////////////////// -// JabberAuthAllow - processes the successful authorization +// AuthAllow - processes the successful authorization int CJabberProto::Authorize(MEVENT hDbEvent) { @@ -430,7 +430,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberAuthDeny - handles the unsuccessful authorization +// AuthDeny - handles the unsuccessful authorization int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) { @@ -452,7 +452,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberAuthRecv - receives a auth +// AuthRecv - receives a auth int CJabberProto::AuthRecv(MCONTACT, PROTORECVEVENT *pre) { @@ -460,7 +460,16 @@ int CJabberProto::AuthRecv(MCONTACT, PROTORECVEVENT *pre) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberFileAllow - starts a file transfer +// AuthRecv - receives a auth + +int CJabberProto::AuthRequest(MCONTACT hContact, const wchar_t *) +{ + AddContactForever(hContact); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////////////// +// FileAllow - starts a file transfer HANDLE CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wchar_t *szPath) { @@ -491,7 +500,7 @@ HANDLE CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wc } //////////////////////////////////////////////////////////////////////////////////////// -// JabberFileCancel - cancels a file transfer +// FileCancel - cancels a file transfer int CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer) { @@ -519,7 +528,7 @@ int CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberFileDeny - denies a file transfer +// FileDeny - denies a file transfer int CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *) { @@ -547,7 +556,7 @@ int CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberFileResume - processes file renaming etc +// FileResume - processes file renaming etc int CJabberProto::FileResume(HANDLE hTransfer, int, const wchar_t *szFilename) { @@ -702,7 +711,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb) HANDLE CJabberProto::SearchBasic(const wchar_t *szJid) { - debugLogA("JabberBasicSearch called with lParam = '%s'", szJid); + debugLogA("JabberBasicSearch called with lParam = '%S'", szJid); JABBER_SEARCH_BASIC *jsb; if (!m_bJabberOnline || (jsb = (JABBER_SEARCH_BASIC*)mir_alloc(sizeof(JABBER_SEARCH_BASIC))) == nullptr) @@ -731,7 +740,7 @@ HANDLE CJabberProto::SearchBasic(const wchar_t *szJid) } else wcsncpy_s(jsb->jid, szJid, _TRUNCATE); - debugLogA("Adding '%s' without validation", jsb->jid); + debugLogA("Adding '%S' without validation", jsb->jid); jsb->hSearch = SerialNext(); ForkThread((MyThreadFunc)&CJabberProto::BasicSearchThread, jsb); return (HANDLE)jsb->hSearch; @@ -752,7 +761,7 @@ HANDLE CJabberProto::SearchByEmail(const wchar_t *email) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberSearchByName - searches the contact by its first or last name, or by a nickname +// SearchByName - searches the contact by its first or last name, or by a nickname HANDLE CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) { @@ -872,7 +881,7 @@ HANDLE CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, w } //////////////////////////////////////////////////////////////////////////////////////// -// JabberSendMessage - sends a message +// SendMessage - sends a message int CJabberProto::SendMsg(MCONTACT hContact, const char *pszSrc) { @@ -975,7 +984,7 @@ int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberSetApparentMode - sets the visibility status +// rSetApparentMode - sets the visibility status int CJabberProto::SetApparentMode(MCONTACT hContact, int mode) { @@ -1055,7 +1064,7 @@ int CJabberProto::SetStatus(int iNewStatus) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberGetAwayMsg - returns a contact's away message +// GetAwayMsg - returns a contact's away message void __cdecl CJabberProto::GetAwayMsgThread(void *param) { @@ -1103,7 +1112,7 @@ HANDLE CJabberProto::GetAwayMsg(MCONTACT hContact) } //////////////////////////////////////////////////////////////////////////////////////// -// JabberSetAwayMsg - sets the away status message +// SetAwayMsg - sets the away status message int CJabberProto::SetAwayMsg(int status, const wchar_t *msg) { @@ -1153,7 +1162,7 @@ int CJabberProto::SetAwayMsg(int status, const wchar_t *msg) } ///////////////////////////////////////////////////////////////////////////////////////// -// JabberUserIsTyping - sends a UTN notification +// UserIsTyping - sends a UTN notification int CJabberProto::UserIsTyping(MCONTACT hContact, int type) { diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 1eed184afc..a907cdc65e 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -120,6 +120,7 @@ struct CJabberProto : public PROTO, public IJabberInterface int Authorize(MEVENT hDbEvent) override; int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override; int AuthRecv(MCONTACT, PROTORECVEVENT *pre) override; + int AuthRequest(MCONTACT, const wchar_t *pwszReason) override; HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override; int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; -- cgit v1.2.3