diff options
author | George Hazan <george.hazan@gmail.com> | 2013-09-06 18:37:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-09-06 18:37:48 +0000 |
commit | ae1afa7d58e0ab42e8e93689c30f7d9084c926e4 (patch) | |
tree | 62609fda94ba1c01a9c4220fc739778b15299c3d /protocols/MRA/src/Mra_functions.cpp | |
parent | 076848a0704b20cca9010da13b4631aede37c1ba (diff) |
more cleaning for MRA
git-svn-id: http://svn.miranda-ng.org/main/trunk@5978 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra_functions.cpp')
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 8e03a93c70..8d3c419bd8 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -466,8 +466,9 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed CMStringA szEMailLocal;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
if (mraGetStringA(hContact, "e-mail", szEMailLocal))
- if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, szEMailLocal.GetLength(), szEmail, szEmail.GetLength()) == CSTR_EQUAL) {
- if (bTemporary == FALSE) db_unset(hContact, "CList", "NotOnList");
+ if (szEMailLocal == szEmail) {
+ if (bTemporary == FALSE)
+ db_unset(hContact, "CList", "NotOnList");
bFound = true;
break;
}
@@ -489,7 +490,7 @@ HANDLE CMraProto::MraHContactFromEmail(const CMStringA& szEmail, BOOL bAddIfNeed BOOL bChatAdded = FALSE;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (mraGetStringA(hContact, "ChatRoomID", szEMailLocal)) {
- if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, szEMailLocal.GetLength(), szEmail, szEmail.GetLength()) == CSTR_EQUAL) {
+ if (szEMailLocal == szEmail) {
bChatAdded = TRUE;
break;
}
@@ -555,16 +556,10 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) {
DWORD dwOldStatus = MraGetContactStatus(hContact);
- if (dwNewStatus != dwOldStatus)
- {
- BOOL bChatAgent;
-
- bChatAgent = IsContactChatAgent(hContact);
-
- if (dwNewStatus == ID_STATUS_OFFLINE)
- {
- if (hContact)
- {
+ if (dwNewStatus != dwOldStatus) {
+ bool bChatAgent = IsContactChatAgent(hContact);
+ if (dwNewStatus == ID_STATUS_OFFLINE) {
+ if (hContact) {
setByte(hContact, DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
delSetting(hContact, DBSETTING_XSTATUSNAME);
delSetting(hContact, DBSETTING_XSTATUSMSG);
@@ -573,27 +568,28 @@ DWORD CMraProto::MraSetContactStatus(HANDLE hContact, DWORD dwNewStatus) delSetting(hContact, DBSETTING_BLOGSTATUS);
delSetting(hContact, DBSETTING_BLOGSTATUSMUSIC);
MraContactCapabilitiesSet(hContact, 0);
- if (bChatAgent) MraChatSessionDestroy(hContact);
+ if (bChatAgent)
+ MraChatSessionDestroy(hContact);
}
setDword(hContact, "LogonTS", 0);
delSetting(hContact, "IP");
delSetting(hContact, "RealIP");
- }else {
- if (dwOldStatus == ID_STATUS_OFFLINE)
- {
+ }
+ else {
+ if (dwOldStatus == ID_STATUS_OFFLINE) {
DWORD dwTime = (DWORD)_time32(NULL);
-
setDword(hContact, "LogonTS", dwTime);
setDword(hContact, "OldLogonTS", dwTime);
- if (bChatAgent) MraChatSessionNew(hContact);
+ if (bChatAgent)
+ MraChatSessionNew(hContact);
}
MraAvatarsQueueGetAvatarSimple(hAvatarsQueueHandle, 0, hContact, 0);
}
setWord(hContact, "Status", (WORD)dwNewStatus);
}
- return(dwOldStatus);
+ return dwOldStatus;
}
void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &pszSubject, DWORD dwDate, DWORD dwUIDL)
|