diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-10 23:33:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-10 23:33:35 +0000 |
commit | 18448e7014c32235db05465f1bf76b30f9954029 (patch) | |
tree | ebf78a23f27c92eeff9ad3d185258ea8fe029e97 /protocols/FacebookRM/src/chat.cpp | |
parent | 452fb59c22573ddf7939bea02b5e58f4f2e3916c (diff) |
GCDEST::pszModule and GCDEST::ptszID must be constant
git-svn-id: http://svn.miranda-ng.org/main/trunk@7586 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/chat.cpp')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 5315294fe7..b002768851 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -30,7 +30,7 @@ void FacebookProto::UpdateChat(const TCHAR *tchat_id, const char *id, const char ptrT tnick( mir_a2t_cp(name,CP_UTF8));
ptrT ttext( mir_a2t_cp(message,CP_UTF8));
- GCDEST gcd = { m_szModuleName, (TCHAR*)tchat_id, GC_EVENT_MESSAGE };
+ GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszText = ttext;
gce.time = timestamp ? timestamp : ::time(NULL);
@@ -146,7 +146,7 @@ void FacebookProto::AddChatContact(const TCHAR *tchat_id, const char *id, const ptrT tnick( mir_a2t_cp(name, CP_UTF8));
ptrT tid( mir_a2t(id));
- GCDEST gcd = { m_szModuleName, (TCHAR *)tchat_id, GC_EVENT_JOIN };
+ GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_JOIN };
GCEVENT gce = { sizeof(gce), &gcd };
gce.pDest = &gcd;
gce.dwFlags = GCEF_ADDTOLOG;
@@ -176,7 +176,7 @@ void FacebookProto::RemoveChatContact(const TCHAR *tchat_id, const char *id) ptrT tid( mir_a2t(id));
- GCDEST gcd = { m_szModuleName, (TCHAR *)tchat_id, GC_EVENT_PART };
+ GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_PART };
GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszUID = gce.ptszNick = tid;
@@ -222,7 +222,7 @@ void FacebookProto::AddChat(const TCHAR *tid, const TCHAR *tname) CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
// Send setting events
- GCDEST gcd = { m_szModuleName, (TCHAR*)tid, GC_EVENT_ADDGROUP };
+ GCDEST gcd = { m_szModuleName, tid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
// Create a user statuses
@@ -271,7 +271,7 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM wParam,LPARAM suppress) return 0;
// Create a group
- GCDEST gcd = { m_szModuleName, (TCHAR*)m_tszUserName, GC_EVENT_ADDGROUP };
+ GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszStatus = _T("Admin");
CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast<LPARAM>(&gce));
@@ -302,10 +302,7 @@ INT_PTR FacebookProto::OnLeaveChat(WPARAM,LPARAM) /*
void FacebookProto::SetChatStatus(int status)
{
- GCDEST gcd = { m_szModuleName };
- gcd.ptszID = const_cast<TCHAR*>(m_tszUserName);
- gcd.iType = GC_EVENT_CONTROL;
-
+ GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
gce.time = ::time(NULL);
|