summaryrefslogtreecommitdiff
path: root/protocols/Yahoo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-08 19:39:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-08 19:39:48 +0000
commit05cd7934d4bdb097e112efdda356946868f3f5d6 (patch)
tree0fa678b494af8b994abf7319298a1af06fc9218a /protocols/Yahoo
parent50a2ba5bf6827b8f010288021c1797c11bd1531e (diff)
- end of ANSI support in chats;
- manual crit section control removed from chat engine; - bunch of memory-related clutches either removed or replaced with smart pointers git-svn-id: http://svn.miranda-ng.org/main/trunk@7549 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r--protocols/Yahoo/src/chat.cpp41
1 files changed, 12 insertions, 29 deletions
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index e4edd7cc3d..0b22d5e23f 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -180,13 +180,11 @@ static const COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
void CYahooProto::ChatRegister(void)
{
- GCREGISTER gcr = {0};
- gcr.cbSize = sizeof(gcr);
- gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR | GC_TCHAR;
- gcr.iMaxText = 0;
+ GCREGISTER gcr = { sizeof(gcr) };
+ gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
gcr.nColors = 16;
gcr.pColors = (COLORREF*)crCols;
- gcr.ptszModuleDispName = m_tszUserName;
+ gcr.ptszDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
@@ -198,22 +196,15 @@ void CYahooProto::ChatStart(const char* room)
{
TCHAR* idt = mir_a2t(room);
- GCSESSION gcw = {0};
- gcw.cbSize = sizeof(gcw);
- gcw.dwFlags = GC_TCHAR;
+ GCSESSION gcw = { sizeof(gcw) };
gcw.iType = GCW_CHATROOM;
gcw.pszModule = m_szModuleName;
gcw.ptszName = idt;
gcw.ptszID = idt;
CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
- GCDEST gcd = { m_szModuleName, { NULL }, GC_EVENT_ADDGROUP };
- gcd.ptszID = idt;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(gce);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
+ GCDEST gcd = { m_szModuleName, idt, GC_EVENT_ADDGROUP };
+ GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszStatus = TranslateT("Me");
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
@@ -233,13 +224,9 @@ void CYahooProto::ChatLeave(const char* room)
{
TCHAR* idt = mir_a2t(room);
- GCDEST gcd = { m_szModuleName, { NULL }, GC_EVENT_CONTROL };
- gcd.ptszID = idt;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR | GCEF_REMOVECONTACT;
- gce.pDest = &gcd;
+ GCDEST gcd = { m_szModuleName, idt, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ gce.dwFlags = GCEF_REMOVECONTACT;
CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
@@ -260,13 +247,9 @@ void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TC
HANDLE hContact = getbuddyH(who);
TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt;
- GCDEST gcd = { m_szModuleName, { NULL }, evt };
- gcd.ptszID = idt;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(gce);
- gce.dwFlags = GC_TCHAR | GCEF_ADDTOLOG;
- gce.pDest = &gcd;
+ GCDEST gcd = { m_szModuleName, idt, evt };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszNick = nick;
gce.ptszUID = snt;
gce.bIsMe = _stricmp(who, m_yahoo_id) == 0;