From be6e15b71fcf555aad8bfd9054ca66ec71b91408 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 20 Jan 2017 20:40:09 +0300 Subject: code cleaning --- protocols/VKontakte/src/vk_chats.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'protocols/VKontakte/src/vk_chats.cpp') 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; } -- cgit v1.2.3