summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-26 14:41:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-26 14:41:21 +0300
commitbe1918c1b2986ddb387cd593deddf120f9e61874 (patch)
treecedf0b0983817b488edcc7eb604f2d44a75c935f /protocols
parent91c5b3baaf5ac2790a99015afcfbf696dff682ca (diff)
fix for chat structures declaration
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/guilds.cpp8
-rw-r--r--protocols/Discord/src/stdafx.h2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp2
-rw-r--r--protocols/MRA/src/MraOfflineMsg.cpp2
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/SkypeWeb/src/stdafx.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
7 files changed, 8 insertions, 12 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 31ce370f8d..cdaf29de05 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -71,7 +71,7 @@ void CDiscordProto::ProcessRole(CDiscordGuild *guild, const JSONNode &role)
static void sttSetGroupName(MCONTACT hContact, const wchar_t *pwszGroupName)
{
ptrW wszOldName(db_get_wsa(hContact, "CList", "Group"));
- if (wszOldName == nullptr)
+ if (wszOldName == nullptr || !mir_wstrcmpi(wszOldName, TranslateT("Chat rooms")))
db_set_ws(hContact, "CList", "Group", pwszGroupName);
}
@@ -80,13 +80,13 @@ void CDiscordProto::BatchChatCreate(void *param)
CDiscordGuild *pGuild = (CDiscordGuild*)param;
for (auto &it : pGuild->arChannels)
- if (!it->bIsPrivate)
+ if (!it->bIsPrivate && !it->bIsGroup)
CreateChat(pGuild, it);
}
void CDiscordProto::CreateChat(CDiscordGuild *pGuild, CDiscordUser *pUser)
{
- GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, pUser->wszUsername, pUser->wszChannelName);
+ SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, pUser->wszUsername, pUser->wszChannelName);
si->pParent = pGuild->pParentSi;
pUser->hContact = si->hContact;
@@ -129,7 +129,7 @@ void CDiscordProto::ProcessGuild(const JSONNode &p)
pGuild->wszName = p["name"].as_mstring();
pGuild->groupId = Clist_GroupCreate(Clist_GroupExists(m_wszDefaultGroup), pGuild->wszName);
- GCSessionInfoBase *si = Chat_NewSession(GCW_SERVER, m_szModuleName, pGuild->wszName, pGuild->wszName, pGuild);
+ SESSION_INFO *si = Chat_NewSession(GCW_SERVER, m_szModuleName, pGuild->wszName, pGuild->wszName, pGuild);
pGuild->pParentSi = (SESSION_INFO*)si;
pGuild->hContact = si->hContact;
setId(si->hContact, DB_KEY_CHANNELID, guildId);
diff --git a/protocols/Discord/src/stdafx.h b/protocols/Discord/src/stdafx.h
index 70bef09fe2..ccbd587d74 100644
--- a/protocols/Discord/src/stdafx.h
+++ b/protocols/Discord/src/stdafx.h
@@ -65,5 +65,3 @@ CMStringW PrepareMessageText(const JSONNode &pRoot);
int StrToStatus(const CMStringW &str);
time_t StringToDate(const CMStringW &str);
int SerialNext(void);
-
-struct SESSION_INFO : public GCSessionInfoBase {};
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 8869d206db..f873fcbde7 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -128,7 +128,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
it.translate();
ptrW szNick(JabberNickFromJID(item->jid));
- GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, item->jid, szNick);
+ SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, item->jid, szNick);
if (si != nullptr) {
item->hContact = si->hContact;
diff --git a/protocols/MRA/src/MraOfflineMsg.cpp b/protocols/MRA/src/MraOfflineMsg.cpp
index 1495f6d2a2..4c2b621c92 100644
--- a/protocols/MRA/src/MraOfflineMsg.cpp
+++ b/protocols/MRA/src/MraOfflineMsg.cpp
@@ -141,7 +141,7 @@ static DWORD PlainText2message(const CMStringA &szContentType, const CMStringA &
size_t dwTextSize;
ptrA lpszText((LPSTR)mir_base64_decode(szBody, &dwTextSize));
if (lpszText) {
- plpsText = CMStringA(lpszText, dwTextSize);
+ plpsText = CMStringA(lpszText, (int)dwTextSize);
if (pdwFlags) {
(*pdwFlags) |= MESSAGE_FLAG_v1p16; // set unicode flag if not exist
(*pdwFlags) &= ~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index da212ffd72..39c95922d4 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -526,7 +526,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe
//not already there: add
if (IsEMailChatAgent(szEmail)) {
CMStringW wszEMail = szEmail;
- GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszEMail, wszEMail);
+ SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszEMail, wszEMail);
if (si != nullptr) {
bool bChatAdded = (si->hContact != NULL);
if (bChatAdded == FALSE)
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h
index a9e15f715c..2be5607f21 100644
--- a/protocols/SkypeWeb/src/stdafx.h
+++ b/protocols/SkypeWeb/src/stdafx.h
@@ -60,8 +60,6 @@ struct CSkypeProto;
extern char g_szMirVer[];
extern HANDLE g_hCallEvent;
-struct SESSION_INFO : public GCSessionInfoBase {};
-
#define SKYPE_ENDPOINTS_HOST "client-s.gateway.messenger.live.com"
struct LoginInfo
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index bb6f1ce870..370a6bc312 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -60,7 +60,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg)
sid.Format(L"%S_%d", m_szModuleName, id);
c->m_wszId = mir_wstrdup(sid);
- GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sid, wszTitle);
+ SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sid, wszTitle);
if (si == nullptr)
return nullptr;