summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-20 20:40:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-20 20:40:09 +0300
commitbe6e15b71fcf555aad8bfd9054ca66ec71b91408 (patch)
treed91d73d99d3ec99d23eed2c948e77c6eb72b22fa /protocols
parentfa78a351b86311df1e19cd5d0e835156a65d1fab (diff)
code cleaning
Diffstat (limited to 'protocols')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp2
-rw-r--r--protocols/VKontakte/src/stdafx.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp19
3 files changed, 9 insertions, 14 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index d015a755b7..45265b9d54 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -1269,7 +1269,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
CMStringW sID = MakeWndID(sChanName);
BYTE btOwnMode = 0;
- if (!Chat_NewSession(GCW_CHATROOM, m_szModuleName, sID, sChanName)) {
+ if (Chat_NewSession(GCW_CHATROOM, m_szModuleName, sID, sChanName)) {
PostIrcMessage(L"/MODE %s", sChanName);
// register the statuses
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h
index e329a467e2..5684a0a1f8 100644
--- a/protocols/VKontakte/src/stdafx.h
+++ b/protocols/VKontakte/src/stdafx.h
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_system_cpp.h>
#include <m_avatars.h>
-#include <m_chat.h>
+#include <m_chat_int.h>
#include <m_clist.h>
#include <m_database.h>
#include <m_file.h>
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 79ee8ff0ed..0de83aaa15 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -59,30 +59,25 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg)
CMStringW sid;
sid.Format(L"%S_%d", m_szModuleName, id);
c->m_wszId = mir_wstrdup(sid);
- Chat_NewSession(GCW_CHATROOM, m_szModuleName, sid, wszTitle);
- GC_INFO gci = {};
- gci.pszModule = m_szModuleName;
- gci.pszID = sid;
- gci.Flags = GCF_BYID | GCF_HCONTACT;
- Chat_GetInfo(&gci);
- c->m_hContact = gci.hContact;
+ GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sid, wszTitle);
+ c->m_hContact = si->hContact;
- setWString(gci.hContact, "Nick", wszTitle);
+ setWString(si->hContact, "Nick", wszTitle);
m_chats.insert(c);
for (int i = _countof(sttStatuses)-1; i >= 0; i--)
Chat_AddGroup(m_szModuleName, sid, TranslateW(sttStatuses[i]));
- setDword(gci.hContact, "vk_chat_id", id);
+ setDword(si->hContact, "vk_chat_id", id);
CMStringW wszHomepage(FORMAT, L"https://vk.com/im?sel=c%d", id);
- setWString(gci.hContact, "Homepage", wszHomepage);
+ setWString(si->hContact, "Homepage", wszHomepage);
- db_unset(gci.hContact, m_szModuleName, "off");
+ db_unset(si->hContact, m_szModuleName, "off");
if (jnDlg && jnDlg["left"].as_bool()) {
- setByte(gci.hContact, "off", 1);
+ setByte(si->hContact, "off", 1);
m_chats.remove(c);
return NULL;
}