diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-08 19:39:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-08 19:39:48 +0000 |
commit | 05cd7934d4bdb097e112efdda356946868f3f5d6 (patch) | |
tree | 0fa678b494af8b994abf7319298a1af06fc9218a /protocols/Skype/src/skype_chat.cpp | |
parent | 50a2ba5bf6827b8f010288021c1797c11bd1531e (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/Skype/src/skype_chat.cpp')
-rw-r--r-- | protocols/Skype/src/skype_chat.cpp | 62 |
1 files changed, 14 insertions, 48 deletions
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp index 3bb2534bbf..6f42d44393 100644 --- a/protocols/Skype/src/skype_chat.cpp +++ b/protocols/Skype/src/skype_chat.cpp @@ -161,17 +161,10 @@ void ChatRoom::CreateChatSession(bool showWindow) gcw.dwItemData = (DWORD)this;
::CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
- GCDEST gcd = { ppro->m_szModuleName, { NULL }, GC_EVENT_ADDGROUP };
- gcd.ptszID = this->cid;
-
// load chat roles
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
-
- for (int i = 1; i < SIZEOF(ChatRoom::Roles) - 2; i++)
- {
+ GCDEST gcd = { ppro->m_szModuleName, this->cid, GC_EVENT_ADDGROUP };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ for (int i = 1; i < SIZEOF(ChatRoom::Roles) - 2; i++) {
gce.ptszStatus = ::TranslateTS(ChatRoom::Roles[i]);
::CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
@@ -205,16 +198,9 @@ wchar_t *ChatRoom::GetUri() void ChatRoom::ShowWindow()
{
- GCDEST gcd = { this->ppro->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
- gcd.ptszID = this->cid;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
-
// show window
- gcd.iType = GC_EVENT_CONTROL;
+ GCDEST gcd = { this->ppro->m_szModuleName, this->cid, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
::CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
}
@@ -357,13 +343,8 @@ void ChatRoom::LeaveChat() if (this->conversation->RetireFrom())
this->ppro->debugLogW(L"Retired from conversation %s", this->cid);
- GCDEST gcd = { ppro->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
- gcd.ptszID = this->cid;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
+ GCDEST gcd = { ppro->m_szModuleName, this->cid, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
::CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
::CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
}
@@ -378,28 +359,19 @@ void ChatRoom::LeaveChatAndDelete() if (this->conversation->Delete())
this->ppro->debugLogW(L"Delete conversation %s", this->cid);
- GCDEST gcd = { ppro->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
- gcd.ptszID = this->cid;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
+ GCDEST gcd = { ppro->m_szModuleName, this->cid, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
::CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
::CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
}
void ChatRoom::SendEvent(const ChatMember &item, int eventType, DWORD timestamp, DWORD flags, DWORD itemData, const wchar_t *status, const wchar_t *message)
{
- GCDEST gcd = { ppro->m_szModuleName, { NULL }, eventType };
- gcd.ptszID = this->cid;
-
bool isMe = this->IsMe(item);
- GCEVENT gce = {0};
- gce.cbSize = sizeof(gce);
- gce.dwFlags = GC_TCHAR | flags;
- gce.pDest = &gcd;
+ GCDEST gcd = { ppro->m_szModuleName, this->cid, eventType };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ gce.dwFlags = flags;
gce.ptszUID = item.GetSid();
gce.ptszNick = !isMe ? item.GetNick() : ::TranslateT("me");
gce.bIsMe = isMe;
@@ -1270,14 +1242,8 @@ void CSkypeProto::CloseAllChatSessions() gci.iItem = i;
if ( !::CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
{
- GCDEST gcd = { this->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
- gcd.ptszID = gci.pszID;
-
- GCEVENT gce = {0};
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = &gcd;
-
+ GCDEST gcd = { this->m_szModuleName, gci.pszID, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
::CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
::CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
}
|