summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_proto.cpp
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-05-14 15:24:53 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-05-14 15:24:53 +0000
commitb7a1174511c3b7fad5b81a54bb4647662d94031c (patch)
tree91b3f36fd78ae9b481cb11d8602e61a79c388d04 /protocols/MSN/src/msn_proto.cpp
parent01b66588ca510b49be5a06d2bfb5bd28b4416030 (diff)
Updated for partial MSNP24 protocol support, for detailed changes see MSNP24 branch.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13589 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_proto.cpp')
-rw-r--r--protocols/MSN/src/msn_proto.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index ab752712b4..d13086edd7 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -38,6 +38,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
m_arContacts(10, CompareLists),
m_arGroups(10, CompareId),
m_arThreads(10, PtrKeySortT),
+ m_arGCThreads(10, PtrKeySortT),
m_arSessions(10, PtrKeySortT),
m_arDirect(10, PtrKeySortT),
lsMessageQueue(1),
@@ -140,6 +141,8 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ m_DisplayNameCache = NULL;
}
CMsnProto::~CMsnProto()
@@ -168,10 +171,12 @@ CMsnProto::~CMsnProto()
mir_free(msnLastStatusMsg);
mir_free(msnPreviousUUX);
mir_free(msnExternalIP);
+ mir_free(msnRegistration);
mir_free(abCacheKey);
mir_free(sharingCacheKey);
mir_free(storageCacheKey);
+ mir_free(m_DisplayNameCache);
FreeAuthTokens();
}
@@ -280,12 +285,13 @@ int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
{
if (msnLoggedIn) {
char email[MSN_MAX_EMAIL_LEN];
- if (db_get_static(hContact, m_szModuleName, "e-mail", email, sizeof(email)))
+ if (db_get_static(hContact, m_szModuleName, "wlid", email, sizeof(email)) &&
+ db_get_static(hContact, m_szModuleName, "e-mail", email, sizeof(email)))
return 1;
char* szMsg = mir_utf8encodeT(szMessage);
- int netId = strncmp(email, "tel:", 4) == 0 ? NETID_MOB : NETID_MSN;
+ int netId = strncmp(email, "tel:", 4) == 0 ? NETID_MOB : (strncmp(email, "live:", 5) == 0 ? NETID_SKYPE : NETID_MSN);
if (MSN_AddUser(hContact, email, netId, LIST_FL, szMsg)) {
MSN_AddUser(hContact, email, netId, LIST_PL + LIST_REMOVE);
MSN_AddUser(hContact, email, netId, LIST_BL + LIST_REMOVE);
@@ -653,7 +659,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT)
return (UINT_PTR)Translate("Live ID");
case PFLAG_UNIQUEIDSETTING:
- return (UINT_PTR)"e-mail";
+ return (UINT_PTR)"wlid";
case PFLAG_MAXLENOFMESSAGE:
return 1202;
@@ -668,7 +674,8 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT)
int __cdecl CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
{
char tEmail[MSN_MAX_EMAIL_LEN];
- db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail));
+ if (db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail)))
+ db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail));
if (Lists_IsInList(LIST_FL, tEmail))
db_unset(hContact, "CList", "Hidden");
@@ -824,7 +831,10 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
else {
const char msgType = MyOptions.SlowSend ? 'A' : 'N';
bool isOffline;
- ThreadData* thread = MSN_StartSB(tEmail, isOffline);
+ ThreadData* thread; // = MSN_StartSB(tEmail, isOffline);
+ /* MSNP24 doesn't have a switchboard anymore */
+ thread = NULL; isOffline = true;
+
if (thread == NULL) {
if (isOffline) {
if (netId != NETID_LCS) {
@@ -948,6 +958,7 @@ int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type)
bool typing = type == PROTOTYPE_SELFTYPING_ON;
int netId = Lists_GetNetId(tEmail);
+ /*
switch (netId) {
case NETID_UNKNOWN:
case NETID_MSN:
@@ -971,6 +982,9 @@ int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type)
default:
break;
}
+ */
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ MSN_SendTyping(msnNsThread, tEmail, netId, typing);
return 0;
}