From 83b409481df770411ce3113a8bb1a787e991e767 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 20 Apr 2015 05:36:13 +0000 Subject: warnings fix git-svn-id: http://svn.miranda-ng.org/main/trunk@12948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_chatrooms.cpp | 370 ++++++++++++++--------------- 1 file changed, 185 insertions(+), 185 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_chatrooms.cpp') diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index bc4f755e4c..7c2946a49a 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -81,123 +81,123 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) return 0; } - switch (gch->pDest->iType) - { - case GC_USER_MESSAGE: - { - ptrA msg(mir_t2a(gch->ptszText)); - ptrA chat_id(mir_t2a(gch->pDest->ptszID)); - - if (IsOnline()) { - debugLogA(" > Chat - Outgoing message"); - SendRequest(new SendChatMessageRequest(RegToken, chat_id, time(NULL), msg, Server)); - } - - break; - } - - case GC_USER_PRIVMESS: - { - /*facebook_user fbu; - fbu.user_id = _T2A(hook->ptszUID, CP_UTF8); - - // Find this contact in list or add new temporary contact - MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE, false, true); - - if (!hContact) - break; - - CallService(MS_MSG_SENDMESSAGET, hContact, 0);*/ - break; - } - - /* - case GC_USER_LOGMENU: - { - switch(hook->dwData) - { - case 10: - DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, invite_to_chat_dialog, - LPARAM(new invite_chat_param(item->id, this))); - break; - - case 20: - //chat_leave(id); - break; - } - break; - } - */ - - case GC_USER_NICKLISTMENU: - { - MCONTACT hContact = NULL; - if (gch->dwData == 10 || gch->dwData == 20) { - - ptrA user_id(mir_t2a(gch->ptszUID, CP_UTF8)); - - // Find this contact in list or add new temporary contact - hContact = AddContact(user_id, true); - - if (!hContact) - break; - - } - - switch (gch->dwData) - { - case 10: - CallService(MS_USERINFO_SHOWDIALOG, hContact, 0); - break; - - case 20: - //CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0); - break; - - case 110: - //chat_leave(id); - break; - } - + switch (gch->pDest->iType) + { + case GC_USER_MESSAGE: + { + ptrA msg(mir_t2a(gch->ptszText)); + ptrA chat_id(mir_t2a(gch->pDest->ptszID)); + + if (IsOnline()) { + debugLogA(" > Chat - Outgoing message"); + SendRequest(new SendChatMessageRequest(RegToken, chat_id, time(NULL), msg, Server)); + } + + break; + } + + case GC_USER_PRIVMESS: + { + /*facebook_user fbu; + fbu.user_id = _T2A(hook->ptszUID, CP_UTF8); + + // Find this contact in list or add new temporary contact + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE, false, true); + + if (!hContact) + break; + + CallService(MS_MSG_SENDMESSAGET, hContact, 0);*/ + break; + } + + /* + case GC_USER_LOGMENU: + { + switch(hook->dwData) + { + case 10: + DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, invite_to_chat_dialog, + LPARAM(new invite_chat_param(item->id, this))); + break; + + case 20: + //chat_leave(id); + break; + } + break; + } + */ + + case GC_USER_NICKLISTMENU: + { + MCONTACT hContact = NULL; + if (gch->dwData == 10 || gch->dwData == 20) { + + ptrA user_id(mir_t2a_cp(gch->ptszUID, CP_UTF8)); + + // Find this contact in list or add new temporary contact + hContact = AddContact(user_id, true); + + if (!hContact) + break; + + } + + switch (gch->dwData) + { + case 10: + CallService(MS_USERINFO_SHOWDIALOG, hContact, 0); + break; + + case 20: + //CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0); + break; + + case 110: + //chat_leave(id); + break; + } + break; } } return 0; } -void CSkypeProto::StartChatRoom(const TCHAR *tid, const TCHAR *tname) -{ - // Create the group chat session - GCSESSION gcw = { sizeof(gcw) }; - gcw.iType = GCW_PRIVMESS; - gcw.ptszID = tid; - gcw.pszModule = m_szModuleName; - gcw.ptszName = tname; - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); - - // Send setting events - GCDEST gcd = { m_szModuleName, tid, GC_EVENT_ADDGROUP }; - GCEVENT gce = { sizeof(gce), &gcd }; - - // Create a user statuses - gce.ptszStatus = TranslateT("Admin"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); - gce.ptszStatus = TranslateT("User"); - CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); - - // Finish initialization - gcd.iType = GC_EVENT_CONTROL; - gce.time = time(NULL); - gce.pDest = &gcd; - - bool hideChats = getBool("HideChats", 1); - - // Add self contact - //AddChatContact(tid, facy.self_.user_id.c_str(), facy.self_.real_name.c_str()); - CallServiceSync(MS_GC_EVENT, (hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), reinterpret_cast(&gce)); - CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast(&gce)); - - SendRequest(new GetChatInfoRequest(RegToken, ptrA(mir_t2a(tid)), Server), &CSkypeProto::OnGetChatInfo); +void CSkypeProto::StartChatRoom(const TCHAR *tid, const TCHAR *tname) +{ + // Create the group chat session + GCSESSION gcw = { sizeof(gcw) }; + gcw.iType = GCW_PRIVMESS; + gcw.ptszID = tid; + gcw.pszModule = m_szModuleName; + gcw.ptszName = tname; + CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + + // Send setting events + GCDEST gcd = { m_szModuleName, tid, GC_EVENT_ADDGROUP }; + GCEVENT gce = { sizeof(gce), &gcd }; + + // Create a user statuses + gce.ptszStatus = TranslateT("Admin"); + CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); + gce.ptszStatus = TranslateT("User"); + CallServiceSync(MS_GC_EVENT, NULL, reinterpret_cast(&gce)); + + // Finish initialization + gcd.iType = GC_EVENT_CONTROL; + gce.time = time(NULL); + gce.pDest = &gcd; + + bool hideChats = getBool("HideChats", 1); + + // Add self contact + //AddChatContact(tid, facy.self_.user_id.c_str(), facy.self_.real_name.c_str()); + CallServiceSync(MS_GC_EVENT, (hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), reinterpret_cast(&gce)); + CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast(&gce)); + + SendRequest(new GetChatInfoRequest(RegToken, ptrA(mir_t2a(tid)), Server), &CSkypeProto::OnGetChatInfo); } int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam) @@ -222,15 +222,15 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) { if (hContact) { - ptrT idT(hContact ? getTStringA(hContact, "ChatRoomID") : NULL); - - GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CONTROL }; - gcd.ptszID = idT; - - GCEVENT gce = { sizeof(gce), &gcd }; - gce.time = ::time(NULL); - - CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast(&gce)); + ptrT idT(hContact ? getTStringA(hContact, "ChatRoomID") : NULL); + + GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CONTROL }; + gcd.ptszID = idT; + + GCEVENT gce = { sizeof(gce), &gcd }; + gce.time = ::time(NULL); + + CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast(&gce)); CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast(&gce)); } return 0; @@ -359,71 +359,71 @@ void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response) } } -void CSkypeProto::RenameChat(const char *chat_id, const char *name) -{ - ptrT tchat_id(mir_a2t(chat_id)); - ptrT tname(mir_a2t_cp(name, CP_UTF8)); - - GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_CHANGESESSIONAME }; - GCEVENT gce = { sizeof(gce), &gcd }; - gce.ptszText = tname; - CallService(MS_GC_EVENT, 0, reinterpret_cast(&gce)); +void CSkypeProto::RenameChat(const char *chat_id, const char *name) +{ + ptrT tchat_id(mir_a2t(chat_id)); + ptrT tname(mir_a2t_cp(name, CP_UTF8)); + + GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_CHANGESESSIONAME }; + GCEVENT gce = { sizeof(gce), &gcd }; + gce.ptszText = tname; + CallService(MS_GC_EVENT, 0, reinterpret_cast(&gce)); +} + +bool CSkypeProto::IsChatContact(const TCHAR *chat_id, const char *id) +{ + ptrA users(GetChatUsers(chat_id)); + return (users != NULL && strstr(users, id) != NULL); +} + +char *CSkypeProto::GetChatUsers(const TCHAR *chat_id) +{ + GC_INFO gci = { 0 }; + gci.Flags = GCF_USERS; + gci.pszModule = m_szModuleName; + gci.pszID = chat_id; + CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); + + // mir_free(gci.pszUsers); + return gci.pszUsers; +} + +void CSkypeProto::AddChatContact(const TCHAR *tchat_id, const char *id, const char *name, const TCHAR *role) +{ + if (IsChatContact(tchat_id, id)) + return; + + ptrT tnick(mir_a2t_cp(name, CP_UTF8)); + ptrT tid(mir_a2t(id)); + + GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_JOIN }; + GCEVENT gce = { sizeof(gce), &gcd }; + gce.pDest = &gcd; + gce.dwFlags = GCEF_ADDTOLOG; + gce.ptszNick = tnick; + gce.ptszUID = tid; + gce.time = time(NULL); + gce.bIsMe = IsMe(id); + gce.ptszStatus = TranslateTS(role); + + CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); } -bool CSkypeProto::IsChatContact(const TCHAR *chat_id, const char *id) -{ - ptrA users(GetChatUsers(chat_id)); - return (users != NULL && strstr(users, id) != NULL); -} - -char *CSkypeProto::GetChatUsers(const TCHAR *chat_id) -{ - GC_INFO gci = { 0 }; - gci.Flags = GCF_USERS; - gci.pszModule = m_szModuleName; - gci.pszID = chat_id; - CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); - - // mir_free(gci.pszUsers); - return gci.pszUsers; -} - -void CSkypeProto::AddChatContact(const TCHAR *tchat_id, const char *id, const char *name, const TCHAR *role) -{ - if (IsChatContact(tchat_id, id)) - return; - - ptrT tnick(mir_a2t_cp(name, CP_UTF8)); - ptrT tid(mir_a2t(id)); - - GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_JOIN }; - GCEVENT gce = { sizeof(gce), &gcd }; - gce.pDest = &gcd; - gce.dwFlags = GCEF_ADDTOLOG; - gce.ptszNick = tnick; - gce.ptszUID = tid; - gce.time = time(NULL); - gce.bIsMe = IsMe(id); - gce.ptszStatus = TranslateTS(role); - - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); -} - -void CSkypeProto::RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name) -{ - if(IsMe(id)) - return; - - ptrT tnick(mir_a2t_cp(name, CP_UTF8)); - ptrT tid(mir_a2t(id)); - - GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_PART }; - GCEVENT gce = { sizeof(gce), &gcd }; - gce.dwFlags = GCEF_ADDTOLOG; - gce.ptszNick = tnick; - gce.ptszUID = tid; - gce.time = time(NULL); - gce.bIsMe = false; - - CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); +void CSkypeProto::RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name) +{ + if(IsMe(id)) + return; + + ptrT tnick(mir_a2t_cp(name, CP_UTF8)); + ptrT tid(mir_a2t(id)); + + GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_PART }; + GCEVENT gce = { sizeof(gce), &gcd }; + gce.dwFlags = GCEF_ADDTOLOG; + gce.ptszNick = tnick; + gce.ptszUID = tid; + gce.time = time(NULL); + gce.bIsMe = false; + + CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast(&gce)); } \ No newline at end of file -- cgit v1.2.3