summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-19 14:17:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-19 14:17:59 +0000
commit9f974ab8617b6b7c19bac9e71d06de89d7e7bd03 (patch)
treeadfbe951d1c291fe0904a083d332889aa043f3ac /protocols/Gadu-Gadu
parent0f37fbfbfe24563a6be07f9abd245374e66cb173 (diff)
- struct GCSESSION died;
- Chat_NewSession simply gets 5 parameters; - minor chat code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@17318 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 8e36822a05..7137639aed 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -308,27 +308,10 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou
mir_snwprintf(status, TranslateT("This is my own conference."));
}
- GCSESSION gcwindow = {};
- gcwindow.iType = GCW_CHATROOM;
- gcwindow.pszModule = m_szModuleName;
- gcwindow.ptszName = sender ? senderName : TranslateT("Conference");
- gcwindow.ptszID = chat->id;
- gcwindow.pItemData = chat;
- gcwindow.ptszStatusbarText = status;
-
- // Here we put nice new hash sign
- wchar_t *name = (wchar_t*)calloc(mir_wstrlen(gcwindow.ptszName) + 2, sizeof(wchar_t));
- *name = '#'; mir_wstrcpy(name + 1, gcwindow.ptszName);
- gcwindow.ptszName = name;
-
// Create new room
- if (Chat_NewSession( &gcwindow)) {
- debugLogW(L"gc_getchat(): Cannot create new chat window %s.", chat->id);
- free(name);
- free(chat);
- return NULL;
- }
- free(name);
+ CMStringW wszTitle(L"#"); wszTitle.Append(sender ? senderName : TranslateT("Conference"));
+ Chat_NewSession(GCW_CHATROOM, m_szModuleName, chat->id, wszTitle, chat);
+ Chat_SetStatusbarText(m_szModuleName, chat->id, status);
// Add normal group
Chat_AddGroup(m_szModuleName, chat->id, TranslateT("Participants"));
@@ -367,8 +350,8 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou
for(i = 0; i < chat->recipients_count; i++) {
MCONTACT hContact = getcontact(chat->recipients[i], 1, 0, NULL);
UIN2IDT(chat->recipients[i], id);
- if (hContact && (name = pcli->pfnGetContactDisplayName(hContact, 0)) != NULL)
- gce.ptszNick = name;
+ if (hContact)
+ gce.ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
else
gce.ptszNick = TranslateT("'Unknown'");
gce.bIsMe = 0;