summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-24 11:20:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-24 11:20:49 +0000
commit6bb9843450cc285c7acc870c79bcc3beae8933b2 (patch)
treeafafbabe2e2a8f6a2ba56d24ae8867320e01c203 /protocols/JabberG/src/jabber_proto.cpp
parent76b283677bd66b4f41289bc211504834bb0f0513 (diff)
major <s>Asshole</s> design flaw removed from Jabber, there's no need to invent monstrous maps to store message-related information
git-svn-id: http://svn.miranda-ng.org/main/trunk@6207 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 14aaaae002..08bbb6cba5 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -67,13 +67,11 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
m_priorityMenuValSet(false),
m_hPrivacyMenuRoot(0),
m_hPrivacyMenuItems(10),
- m_pLastResourceList(NULL),
m_lstJabberFeatCapPairsDynamic(2),
m_uEnabledFeatCapsDynamic(0)
{
InitializeCriticalSection(&m_csModeMsgMutex);
InitializeCriticalSection(&m_csLists);
- InitializeCriticalSection(&m_csLastResourceMap);
m_szXmlStreamToBeInitialized = NULL;
@@ -179,8 +177,6 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
db_free(&dbv);
delSetting("Password");
}
-
- CleanLastResourceMap();
}
CJabberProto::~CJabberProto()
@@ -199,8 +195,6 @@ CJabberProto::~CJabberProto()
DestroyHookableEvent(m_hEventXStatusIconChanged);
DestroyHookableEvent(m_hEventXStatusChanged);
- CleanLastResourceMap();
-
ListWipe();
DeleteCriticalSection(&m_csLists);
@@ -209,7 +203,6 @@ CJabberProto::~CJabberProto()
DeleteCriticalSection(&m_filterInfo.csPatternLock);
DeleteCriticalSection(&m_csModeMsgMutex);
- DeleteCriticalSection(&m_csLastResourceMap);
mir_free(m_modeMsgs.szOnline);
mir_free(m_modeMsgs.szAway);
@@ -311,7 +304,6 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
}
}
- CleanLastResourceMap();
return 0;
}
@@ -914,7 +906,7 @@ int __cdecl CJabberProto::RecvContacts(HANDLE /*hContact*/, PROTORECVEVENT*)
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
+int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET *evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -922,19 +914,12 @@ int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET* evt)
////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
+int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *evt)
{
- INT_PTR nDbEvent = Proto_RecvMessage(hContact, evt);
-
- EnterCriticalSection(&m_csLastResourceMap);
- if (IsLastResourceExists((void*)evt->lParam)) {
- m_ulpResourceToDbEventMap[ m_dwResourceMapPointer++ ] = nDbEvent;
- m_ulpResourceToDbEventMap[ m_dwResourceMapPointer++ ] = evt->lParam;
- if (m_dwResourceMapPointer >= SIZEOF(m_ulpResourceToDbEventMap))
- m_dwResourceMapPointer = 0;
- }
- LeaveCriticalSection(&m_csLastResourceMap);
-
+ ptrA szResUtf( mir_utf8encodeT((LPCTSTR)evt->lParam));
+ evt->pCustomData = szResUtf;
+ evt->cbCustomDataSize = lstrlenA(szResUtf);
+ Proto_RecvMessage(hContact, evt);
return 0;
}