summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 981610f811..b1169e26ab 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -514,12 +514,11 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
///////////////////////////////////////////////////////////////////////////////
// JabberGetPacketID - converts the xml id attribute into an integer
-int JabberGetPacketID(const TiXmlElement *n)
+int JabberGetPacketID(const char *str)
{
- const char *str = XmlGetAttr(n, "id");
- if (str)
- if (!strncmp(str, JABBER_IQID, _countof(JABBER_IQID) - 1))
- return atoi(str + _countof(JABBER_IQID) - 1);
+ if (mir_strlen(str) >= 20)
+ if (!memcmp(str, "mir", 3) && !memcmp(g_plugin.szRandom, str+3, 16) && str[19] == '_')
+ return atoi(str + 20);
return -1;
}
@@ -527,7 +526,7 @@ int JabberGetPacketID(const TiXmlElement *n)
char* JabberId2string(int id)
{
char text[100];
- mir_snprintf(text, JABBER_IQID "%d", id);
+ mir_snprintf(text, "mir%s_%d", g_plugin.szRandom, id);
return mir_strdup(text);
}
@@ -693,7 +692,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
else {
ppro->m_pInfoFrame->RemoveInfoItem("$/PEP/");
ppro->m_pInfoFrame->CreateInfoItem("$/PEP", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", ppro->GetIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", g_plugin.getIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
ppro->m_pInfoFrame->CreateInfoItem("$/PEP/mood", true);
ppro->m_pInfoFrame->SetInfoItemCallback("$/PEP/mood", &CJabberProto::InfoFrame_OnUserMood);
@@ -706,7 +705,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
ppro->m_pInfoFrame->RemoveInfoItem("$/Transports/");
ppro->m_pInfoFrame->CreateInfoItem("$/Transports", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", ppro->GetIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", g_plugin.getIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
JABBER_LIST_ITEM *item = nullptr;
LISTFOREACH(i, ppro, LIST_ROSTER)
@@ -720,7 +719,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
char name[128];
mir_snprintf(name, "$/Transports/%s", item->jid);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
- ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
+ ppro->m_pInfoFrame->UpdateInfoItem(name, g_plugin.getIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport);
}
}