From d42f1c7fa5feb305e6f43722d7f36da86d885ed5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 17 Feb 2020 14:51:55 +0300 Subject: Jabber: massive options code cleaning --- protocols/JabberG/src/jabber_menu.cpp | 57 +--------------- protocols/JabberG/src/jabber_opt.cpp | 5 +- protocols/JabberG/src/jabber_opttree.cpp | 7 +- protocols/JabberG/src/jabber_opttree.h | 8 +-- protocols/JabberG/src/jabber_proto.cpp | 71 ++++++++------------ protocols/JabberG/src/jabber_proto.h | 111 +++++++++++++++---------------- protocols/JabberG/src/jabber_svc.cpp | 2 - protocols/JabberG/src/jabber_vcard.cpp | 2 - 8 files changed, 96 insertions(+), 167 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index da7f2956ea..f045dc143f 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -39,7 +39,6 @@ static HANDLE hStatusMenuInit; static int hChooserMenu; static int iChooserMenuPos = 30000; -static HGENMENU g_hMenuRosterAdd; static HGENMENU g_hMenuAddBookmark; static HGENMENU g_hMenuLogin; static HGENMENU g_hMenuRefresh; @@ -71,12 +70,6 @@ static INT_PTR JabberMenuChooseService(WPARAM wParam, LPARAM lParam) return 0; } -static INT_PTR JabberMenuRosterAdd(WPARAM hContact, LPARAM lParam) -{ - CJabberProto *ppro = CMPlugin::getInstance(hContact); - return(ppro) ? ppro->OnMenuRosterAdd(hContact, lParam) : 0; -} - static INT_PTR JabberMenuBookmarkAdd(WPARAM hContact, LPARAM lParam) { CJabberProto *ppro = CMPlugin::getInstance(hContact); @@ -123,7 +116,6 @@ static int JabberPrebuildContactMenu(WPARAM hContact, LPARAM lParam) { Menu_ShowItem(g_hMenuCommands, false); Menu_ShowItem(g_hMenuSendNote, false); - Menu_ShowItem(g_hMenuRosterAdd, false); Menu_ShowItem(g_hMenuLogin, false); Menu_ShowItem(g_hMenuRefresh, false); Menu_ShowItem(g_hMenuAddBookmark, false); @@ -157,15 +149,6 @@ void g_MenuInit(void) CMenuItem mi(&g_plugin); mi.flags = CMIF_UNMOVABLE; - // "Add to roster" - SET_UID(mi, 0x3928ba10, 0x69bc, 0x4ec9, 0x96, 0x48, 0xa4, 0x1b, 0xbe, 0x58, 0x4a, 0x7e); - mi.pszService = "Jabber/AddToRoster"; - mi.name.a = LPGEN("Add to roster"); - mi.position = -1999901005; - mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD); - g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi); - CreateServiceFunction(mi.pszService, JabberMenuRosterAdd); - // "Add to Bookmarks" SET_UID(mi, 0x7d06d00b, 0x3a3e, 0x4d65, 0xac, 0xc5, 0x63, 0xe2, 0x60, 0xbe, 0xc6, 0x6); mi.pszService = "Jabber/AddToBookmarks"; @@ -269,7 +252,6 @@ void g_MenuUninit(void) { DestroyHookableEvent(hStatusMenuInit); - Menu_RemoveItem(g_hMenuRosterAdd); Menu_RemoveItem(g_hMenuLogin); Menu_RemoveItem(g_hMenuRefresh); Menu_RemoveItem(g_hMenuAddBookmark); @@ -297,13 +279,9 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) if (bIsChatRoom) { ptrA roomid(getUStringA(hContact, "ChatRoomID")); - if (roomid != nullptr) { - Menu_ShowItem(g_hMenuRosterAdd, FALSE); - - if (ListGetItemPtr(LIST_BOOKMARK, roomid) == nullptr) - if (m_ThreadInfo && m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE) - Menu_ShowItem(g_hMenuAddBookmark, TRUE); - } + if (ListGetItemPtr(LIST_BOOKMARK, roomid) == nullptr) + if (m_ThreadInfo && m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE) + Menu_ShowItem(g_hMenuAddBookmark, TRUE); } if (bIsChatRoom == GCW_CHATROOM) @@ -382,35 +360,6 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) return 0; } -INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) -{ - if (!hContact) - return 0; // we do not add ourself to the roster. (buggy situation - should not happen) - - ptrA roomID(getUStringA(hContact, "ChatRoomID")); - if (roomID == nullptr) - return 0; - - if (ListGetItemPtr(LIST_ROSTER, roomID) == nullptr) { - ptrA group(db_get_utfa(hContact, "CList", "Group")); - ptrA nick(getUStringA(hContact, "Nick")); - - AddContactToRoster(roomID, nick, group); - if (m_bAddRoster2Bookmarks == TRUE) { - JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_BOOKMARK, roomID); - if (item == nullptr) { - item = new JABBER_LIST_ITEM(); - item->jid = mir_strdup(roomID); - item->name = mir_wstrdup(Utf2T(nick)); - item->nick = getUStringA(hContact, "MyNick"); - AddEditBookmark(item); - delete item; - } - } - } - return 0; -} - INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM) { if (hContact != 0 && m_bJabberOnline) { diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index d1c43da5f9..f3490a1c0c 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -741,7 +741,7 @@ class CDlgOptAdvanced : public CJabberDlgBase CCtrlEdit m_txtDirect; CCtrlTreeOpts m_otvOptions; - BYTE m_oldFrameValue; + bool m_oldFrameValue; public: CDlgOptAdvanced(CJabberProto *proto) : @@ -768,6 +768,7 @@ public: m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable user activity receiving"), m_proto->m_bEnableUserActivity); m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Receive notes"), m_proto->m_bAcceptNotes); m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Automatically save received notes"), m_proto->m_bAutosaveNotes); + m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Inline pictures in messages (XEO-0231)"), m_proto->m_bInlinePictures); m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable server-side history (XEP-0136)"), m_proto->m_bEnableMsgArchive); m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Receive conversations from other devices (XEP-0280)"), m_proto->m_bEnableCarbons); m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Use Stream Management (XEP-0198) if possible (Testing)"), m_proto->m_bEnableStreamMgmt); @@ -878,7 +879,7 @@ public: m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Autoaccept multiuser chat invitations"), m_proto->m_bAutoAcceptMUC); m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join bookmarks on login"), m_proto->m_bAutoJoinBookmarks); m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join conferences on login"), m_proto->m_bAutoJoinConferences); - m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Do not open chat windows on creation"), m_proto->m_bAutoJoinHidden); + m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Do not open chat windows on creation"), m_proto->m_bAutoJoinHidden); m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Do not show multiuser chat invitations"), m_proto->m_bIgnoreMUCInvites); m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Ban notifications"), m_proto->m_bGcLogBans); m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Room configuration changes"), m_proto->m_bGcLogConfig); diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index 84bd684683..46f979bc7d 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -41,7 +41,7 @@ CCtrlTreeOpts::~CCtrlTreeOpts() delete it; } -void CCtrlTreeOpts::AddOption(wchar_t *szOption, CMOption &option) +void CCtrlTreeOpts::AddOption(wchar_t *szOption, CMOption &option) { m_options.insert(new COptionsItem(szOption, option), m_options.getCount()); } @@ -226,8 +226,9 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti) SetItem(&tvi); } -CCtrlTreeOpts::COptionsItem::COptionsItem(wchar_t *szOption, CMOption &option) : -m_option(&option), m_groupId(OPTTREE_CHECK), m_hItem(nullptr) +CCtrlTreeOpts::COptionsItem::COptionsItem(wchar_t *szOption, CMOption &option) : + m_option(&option), + m_groupId(OPTTREE_CHECK) { m_szOptionName = mir_wstrdup(szOption); } diff --git a/protocols/JabberG/src/jabber_opttree.h b/protocols/JabberG/src/jabber_opttree.h index b40d673eca..a1dab5d5f1 100644 --- a/protocols/JabberG/src/jabber_opttree.h +++ b/protocols/JabberG/src/jabber_opttree.h @@ -37,7 +37,7 @@ public: CCtrlTreeOpts(CDlgBase* dlg, int ctrlId); ~CCtrlTreeOpts(); - void AddOption(wchar_t *szOption, CMOption &option); + void AddOption(wchar_t *szOption, CMOption &option); BOOL OnNotify(int idCtrl, NMHDR *pnmh) override; void OnDestroy() override; @@ -50,11 +50,11 @@ protected: wchar_t *m_szOptionName; int m_groupId; - CMOption *m_option; + CMOption *m_option; - HTREEITEM m_hItem; + HTREEITEM m_hItem = nullptr; - COptionsItem(wchar_t *szOption, CMOption &option); + COptionsItem(wchar_t *szOption, CMOption &option); ~COptionsItem(); }; diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 9a3008cfa8..bb71ff5212 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -75,64 +75,63 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) : m_uEnabledFeatCapsDynamic(0), m_StrmMgmt(this), - m_bBsDirect(this, "BsDirect", true), - m_bAllowVersionRequests(this, "m_bAllowVersionRequests", true), m_bAcceptHttpAuth(this, "m_bAcceptHttpAuth", true), - m_bAddRoster2Bookmarks(this, "m_bAddRoster2Bookmarks", true), + m_bAcceptNotes(this, "AcceptNotes", true), + m_bAllowVersionRequests(this, "m_bAllowVersionRequests", true), m_bAutoAcceptAuthorization(this, "AutoAcceptAuthorization", false), m_bAutoAcceptMUC(this, "AutoAcceptMUC", false), m_bAutoAdd(this, "AutoAdd", true), m_bAutoJoinBookmarks(this, "AutoJoinBookmarks", true), - m_bAutoJoinConferences(this, "AutoJoinConferences", 0), + m_bAutoJoinConferences(this, "AutoJoinConferences", false), m_bAutoJoinHidden(this, "AutoJoinHidden", true), - m_bAvatarType(this, "AvatarType", PA_FORMAT_UNKNOWN), + m_bAutosaveNotes(this, "AutosaveNotes", false), + m_bBsDirect(this, "BsDirect", true), m_bBsDirectManual(this, "BsDirectManual", false), m_bBsOnlyIBB(this, "BsOnlyIBB", false), m_bBsProxyManual(this, "BsProxyManual", false), m_bDisable3920auth(this, "Disable3920auth", false), m_bDisableFrame(this, "DisableFrame", true), m_bEnableAvatars(this, "EnableAvatars", true), - m_bEnableRemoteControl(this, "EnableRemoteControl", false), + m_bEnableCarbons(this, "EnableCarbons", true), m_bEnableMsgArchive(this, "EnableMsgArchive", false), + m_bEnableRemoteControl(this, "EnableRemoteControl", false), + m_bEnableStreamMgmt(this, "UseStreamMgmt", false), m_bEnableUserActivity(this, "EnableUserActivity", true), m_bEnableUserMood(this, "EnableUserMood", true), m_bEnableUserTune(this, "EnableUserTune", false), m_bEnableZlib(this, "EnableZlib", true), - m_bExtendedSearch(this, "ExtendedSearch", true), m_bFixIncorrectTimestamps(this, "FixIncorrectTimestamps", true), m_bGcLogAffiliations(this, "GcLogAffiliations", false), m_bGcLogBans(this, "GcLogBans", true), + m_bGcLogChatHistory(this, "GcLogChatHistory", true), m_bGcLogConfig(this, "GcLogConfig", false), m_bGcLogRoles(this, "GcLogRoles", false), m_bGcLogStatuses(this, "GcLogStatuses", false), - m_bGcLogChatHistory(this, "GcLogChatHistory", true), m_bHostNameAsResource(this, "HostNameAsResource", false), m_bIgnoreMUCInvites(this, "IgnoreMUCInvites", false), + m_bIgnoreRosterGroups(this, "IgnoreRosterGroups", false), + m_bInlinePictures(this, "InlinePictures", true), m_bKeepAlive(this, "KeepAlive", true), m_bLogChatstates(this, "LogChatstates", false), m_bLogPresence(this, "LogPresence", true), m_bLogPresenceErrors(this, "LogPresenceErrors", false), m_bManualConnect(this, "ManualConnect", false), m_bMsgAck(this, "MsgAck", false), + m_bProcessXMPPLinks(this, "ProcessXMPPLinks", false), + m_bRcMarkMessagesAsRead(this, "RcMarkMessagesAsRead", true), m_bRosterSync(this, "RosterSync", false), m_bSavePassword(this, "SavePassword", true), m_bShowForeignResourceInMirVer(this, "ShowForeignResourceInMirVer", false), m_bShowOSVersion(this, "ShowOSVersion", true), m_bShowTransport(this, "ShowTransport", true), - m_bUseSSL(this, "UseSSL", false), - m_bUseTLS(this, "UseTLS", true), m_bUseDomainLogin(this, "UseDomainLogin", false), - m_bAcceptNotes(this, "AcceptNotes", true), - m_bAutosaveNotes(this, "AutosaveNotes", false), - m_bRcMarkMessagesAsRead(this, "RcMarkMessagesAsRead", 1), - m_iConnectionKeepAliveInterval(this, "ConnectionKeepAliveInterval", 60000), - m_iConnectionKeepAliveTimeout(this, "ConnectionKeepAliveTimeout", 50000), - m_bProcessXMPPLinks(this, "ProcessXMPPLinks", false), - m_bIgnoreRosterGroups(this, "IgnoreRosterGroups", false), - m_bEnableCarbons(this, "EnableCarbons", true), m_bUseHttpUpload(this, "UseHttpUpload", false), m_bUseOMEMO(this, "UseOMEMO", false), - m_bEnableStreamMgmt(this, "UseStreamMgmt", false) + m_bUseSSL(this, "UseSSL", false), + m_bUseTLS(this, "UseTLS", true), + + m_iConnectionKeepAliveInterval(this, "ConnectionKeepAliveInterval", 60000), + m_iConnectionKeepAliveTimeout(this, "ConnectionKeepAliveTimeout", 50000) { debugLogA("Setting protocol/module name to '%s'", m_szModuleName); @@ -756,36 +755,22 @@ HANDLE CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, if (!m_bJabberOnline || szServerName == nullptr) return nullptr; - BOOL bIsExtFormat = m_bExtendedSearch; - - CJabberIqInfo *pInfo = AddIQ((bIsExtFormat) ? &CJabberProto::OnIqResultExtSearch : &CJabberProto::OnIqResultSetSearch, JABBER_IQ_TYPE_SET, szServerName); + CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultExtSearch, JABBER_IQ_TYPE_SET, szServerName); XmlNodeIq iq(pInfo); TiXmlElement *query = iq << XQUERY(JABBER_FEAT_JUD); - if (bIsExtFormat) { - if (m_tszSelectedLang) - iq << XATTR("xml:lang", m_tszSelectedLang); + if (m_tszSelectedLang) + iq << XATTR("xml:lang", m_tszSelectedLang); - TiXmlElement *x = query << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "submit"); - if (nick[0] != '\0') - x << XCHILD("field") << XATTR("var", "user") << XATTR("value", T2Utf(nick)); + TiXmlElement *x = query << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "submit"); + if (nick[0] != '\0') + x << XCHILD("field") << XATTR("var", "user") << XATTR("value", T2Utf(nick)); - if (firstName[0] != '\0') - x << XCHILD("field") << XATTR("var", "fn") << XATTR("value", T2Utf(firstName)); + if (firstName[0] != '\0') + x << XCHILD("field") << XATTR("var", "fn") << XATTR("value", T2Utf(firstName)); - if (lastName[0] != '\0') - x << XCHILD("field") << XATTR("var", "given") << XATTR("value", T2Utf(lastName)); - } - else { - if (nick[0] != '\0') - query << XCHILD("nick", T2Utf(nick)); - - if (firstName[0] != '\0') - query << XCHILD("first", T2Utf(firstName)); - - if (lastName[0] != '\0') - query << XCHILD("last", T2Utf(lastName)); - } + if (lastName[0] != '\0') + x << XCHILD("field") << XATTR("var", "given") << XATTR("value", T2Utf(lastName)); m_ThreadInfo->send(iq); return (HANDLE)pInfo->GetIqId(); diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 5ae2686229..bb18313b0f 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -170,62 +170,60 @@ struct CJabberProto : public PROTO, public IJabberInterface ThreadData* m_ThreadInfo; - CMOption m_bAllowVersionRequests; - CMOption m_bAcceptHttpAuth; - CMOption m_bAddRoster2Bookmarks; - CMOption m_bAutoAcceptAuthorization; - CMOption m_bAutoAcceptMUC; - CMOption m_bAutoAdd; - CMOption m_bAutoJoinBookmarks; - CMOption m_bAutoJoinConferences; - CMOption m_bAutoJoinHidden; - CMOption m_bAvatarType; - CMOption m_bBsDirect; - CMOption m_bBsDirectManual; - CMOption m_bBsOnlyIBB; - CMOption m_bBsProxyManual; - CMOption m_bDisable3920auth; - CMOption m_bDisableFrame; - CMOption m_bEnableAvatars; - CMOption m_bEnableRemoteControl; - CMOption m_bEnableUserActivity; - CMOption m_bEnableUserMood; - CMOption m_bEnableUserTune; - CMOption m_bEnableZlib; - CMOption m_bExtendedSearch; - CMOption m_bFixIncorrectTimestamps; - CMOption m_bGcLogAffiliations; - CMOption m_bGcLogBans; - CMOption m_bGcLogConfig; - CMOption m_bGcLogRoles; - CMOption m_bGcLogStatuses; - CMOption m_bGcLogChatHistory; - CMOption m_bHostNameAsResource; - CMOption m_bIgnoreMUCInvites; - CMOption m_bKeepAlive; - CMOption m_bLogChatstates; - CMOption m_bLogPresence; - CMOption m_bLogPresenceErrors; - CMOption m_bManualConnect; - CMOption m_bMsgAck; - CMOption m_bRosterSync; - CMOption m_bSavePassword; - CMOption m_bUseDomainLogin; - CMOption m_bShowForeignResourceInMirVer; - CMOption m_bShowOSVersion; - CMOption m_bShowTransport; - CMOption m_bUseSSL; - CMOption m_bUseTLS; - CMOption m_bAcceptNotes; - CMOption m_bAutosaveNotes; - CMOption m_bEnableMsgArchive; - CMOption m_bRcMarkMessagesAsRead; - CMOption m_bProcessXMPPLinks; - CMOption m_bIgnoreRosterGroups; - CMOption m_bEnableCarbons; - CMOption m_bUseHttpUpload; - CMOption m_bUseOMEMO; - CMOption m_bEnableStreamMgmt; + CMOption m_bAcceptHttpAuth; + CMOption m_bAcceptNotes; + CMOption m_bAllowVersionRequests; + CMOption m_bAutoAcceptAuthorization; + CMOption m_bAutoAcceptMUC; + CMOption m_bAutoAdd; + CMOption m_bAutoJoinBookmarks; + CMOption m_bAutoJoinConferences; + CMOption m_bAutoJoinHidden; + CMOption m_bAutosaveNotes; + CMOption m_bBsDirect; + CMOption m_bBsDirectManual; + CMOption m_bBsOnlyIBB; + CMOption m_bBsProxyManual; + CMOption m_bDisable3920auth; + CMOption m_bDisableFrame; + CMOption m_bEnableAvatars; + CMOption m_bEnableCarbons; + CMOption m_bEnableMsgArchive; + CMOption m_bEnableRemoteControl; + CMOption m_bEnableStreamMgmt; + CMOption m_bEnableUserActivity; + CMOption m_bEnableUserMood; + CMOption m_bEnableUserTune; + CMOption m_bEnableZlib; + CMOption m_bFixIncorrectTimestamps; + CMOption m_bGcLogAffiliations; + CMOption m_bGcLogBans; + CMOption m_bGcLogChatHistory; + CMOption m_bGcLogConfig; + CMOption m_bGcLogRoles; + CMOption m_bGcLogStatuses; + CMOption m_bHostNameAsResource; + CMOption m_bIgnoreMUCInvites; + CMOption m_bIgnoreRosterGroups; + CMOption m_bInlinePictures; + CMOption m_bKeepAlive; + CMOption m_bLogChatstates; + CMOption m_bLogPresence; + CMOption m_bLogPresenceErrors; + CMOption m_bManualConnect; + CMOption m_bMsgAck; + CMOption m_bProcessXMPPLinks; + CMOption m_bRcMarkMessagesAsRead; + CMOption m_bRosterSync; + CMOption m_bSavePassword; + CMOption m_bShowForeignResourceInMirVer; + CMOption m_bShowOSVersion; + CMOption m_bShowTransport; + CMOption m_bUseDomainLogin; + CMOption m_bUseHttpUpload; + CMOption m_bUseOMEMO; + CMOption m_bUseSSL; + CMOption m_bUseTLS; CMOption m_iConnectionKeepAliveInterval; CMOption m_iConnectionKeepAliveTimeout; @@ -646,7 +644,6 @@ struct CJabberProto : public PROTO, public IJabberInterface //---- jabber_menu.cpp --------------------------------------------------------------- - INT_PTR __cdecl OnMenuRosterAdd(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuOptions(WPARAM wParam, LPARAM lParam); diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 8f7bd27e00..739c9c35a1 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -269,8 +269,6 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam) char buf[MIR_SHA1_HASH_SIZE * 2 + 1]; bin2hex(digest, sizeof(digest), buf); - m_bAvatarType = ProtoGetBufferFormat(pResult); - GetAvatarFileName(0, tFileName, MAX_PATH); FILE *out = _wfopen(tFileName, L"wb"); if (out != nullptr) { diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 869c7530fa..0a0319f9da 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -1153,8 +1153,6 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName) char buf[MIR_SHA1_HASH_SIZE * 2 + 1]; bin2hex(digest, sizeof(digest), buf); - m_bAvatarType = ProtoGetBufferFormat(buffer); - if (bPhotoChanged) { DeleteFile(szAvatarName); -- cgit v1.2.3