diff options
author | George Hazan <ghazan@miranda.im> | 2022-06-20 17:32:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-06-20 17:32:17 +0300 |
commit | 2ad20823d00c39d67ee0608c9cdd33e49e39b51f (patch) | |
tree | e3f635c13d3d30d64b1bab553528da86aaade618 | |
parent | 54a27f0906931ea0f4fabbde4b67393836a717e6 (diff) |
Jabber: code cleaning
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 3 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_roster.cpp | 5 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 7 |
3 files changed, 7 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index b3e3845692..0a34799fcb 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -129,7 +129,8 @@ void CJabberProto::FtInitiate(filetransfer *ft) uint32_t maxsize = getDword("HttpUploadMaxSize");
if (maxsize && st.st_size > maxsize) {
- MsgPopup(ft->std.hContact, CMStringW(FORMAT, TranslateT("%s is too large. Maximum size supported by the service is %d KB"), ft->std.szCurrentFile.w, maxsize), L"HTTP Upload");
+ MsgPopup(ft->std.hContact, CMStringW(FORMAT, TranslateT("%s is too large. Maximum size supported by the service is %d KB"),
+ ft->std.szCurrentFile.w, maxsize / 1024), L"HTTP Upload");
goto LBL_Error;
}
diff --git a/protocols/JabberG/src/jabber_roster.cpp b/protocols/JabberG/src/jabber_roster.cpp index 2492795862..5072fe9ebb 100644 --- a/protocols/JabberG/src/jabber_roster.cpp +++ b/protocols/JabberG/src/jabber_roster.cpp @@ -336,9 +336,8 @@ public: T2Utf szJid(jid), szName(name), szGroup(group), szSubscr(subscr); auto *itemRoster = XmlGetChildByTag(queryRoster, "item", "jid", szJid); - BOOL bRemove = !m_list.GetCheckState(index); - if (itemRoster && bRemove) { - //delete item + bool bRemove = !m_list.GetCheckState(index); + if (itemRoster && bRemove) { // delete item XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::_RosterHandleGetRequest, JABBER_IQ_TYPE_SET)); iq << XCHILDNS("query", JABBER_FEAT_IQ_ROSTER) << XCHILD("item") << XATTR("jid", szJid) << XATTR("subscription", "remove"); m_proto->m_ThreadInfo->send(iq); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 8bead26b61..4696897bd9 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1575,17 +1575,16 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info) iq << XATTR("to", szBareFrom);
iq << XCHILDNS("pubsub", "http://jabber.org/protocol/pubsub")
<< XCHILD("items") << XATTR("node", JABBER_FEAT_OMEMO ".devicelist");
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET))
- << XCHILDNS("query", JABBER_FEAT_IQ_ROSTER));
-
m_ThreadInfo->send(iq);
}
+
if (!ListGetItemPtr(LIST_ROSTER, from)) {
debugLogA("Receive presence online from %s (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from, hContact);
}
+
DBCheckIsTransportedContact(from, hContact);
+
int status = ID_STATUS_ONLINE;
if (auto *show = XmlGetChildText(node, "show")) {
if (!mir_strcmp(show, "away")) status = ID_STATUS_AWAY;
|