summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Mra_functions.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-20 00:11:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-20 00:11:36 +0300
commit92b173c3a8553b59077aa2757c9627cb4c73d29e (patch)
tree99b7ebeff5c84ff27f1908eea79992e60618840f /protocols/MRA/src/Mra_functions.cpp
parent92e81067e7e81cefcea58f7e91f6d2d8c959fd0d (diff)
Chat_NewSession to return a pointer to a newly created session, not to dig it anymore
Diffstat (limited to 'protocols/MRA/src/Mra_functions.cpp')
-rw-r--r--protocols/MRA/src/Mra_functions.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index da0f03fd69..d894a0299f 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -526,16 +526,9 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe
//not already there: add
if (IsEMailChatAgent(szEmail)) {
CMStringW wszEMail = szEmail;
- if (Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszEMail, wszEMail) == 0) {
- BOOL bChatAdded = FALSE;
- for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (mraGetStringA(hContact, "ChatRoomID", szEMailLocal)) {
- if (szEMailLocal == szEmail) {
- bChatAdded = TRUE;
- break;
- }
- }
- }
+ GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszEMail, wszEMail);
+ if (si != 0) {
+ bool bChatAdded = (si->hContact != NULL);
if (bChatAdded == FALSE)
hContact = NULL;
}