diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-04-10 18:26:49 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-04-10 18:26:49 +0000 |
commit | e372b5c98c28088a666e8f8050c0ec57e7b326de (patch) | |
tree | 5556e072c2b649f598c51404b184880f928af0f6 /protocols/SkypeWeb/src/skype_chatrooms.cpp | |
parent | 9cecda91ac7e563b14fdba9d9cd5feea3faccf69 (diff) |
SkypeWeb: Fixed some bugs from coverity
git-svn-id: http://svn.miranda-ng.org/main/trunk@12751 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_chatrooms.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 6662f9c786..b49dff041a 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -17,13 +17,51 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "common.h"
-MCONTACT CSkypeProto::FindChatRoom(const char *skypename)
+void CSkypeProto::InitGroupChatModule()
+{
+ GCREGISTER gcr = { sizeof(gcr) };
+ gcr.iMaxText = 0;
+ gcr.ptszDispName = this->m_tszUserName;
+ gcr.pszModule = this->m_szModuleName;
+ CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);
+
+ //HookProtoEvent(ME_GC_EVENT, &CSkypeProto::OnGroupChatEventHook);
+ //HookProtoEvent(ME_GC_BUILDMENU, &CSkypeProto::OnGroupChatMenuHook);
+
+ //CreateProtoService(PS_JOINCHAT, &CSkypeProto::OnJoinChatRoom);
+ //CreateProtoService(PS_LEAVECHAT, &CSkypeProto::OnLeaveChatRoom);
+}
+
+void CSkypeProto::CloseAllChatChatSessions()
+{
+ GC_INFO gci = { 0 };
+ gci.Flags = GCF_BYINDEX | GCF_ID | GCF_DATA;
+ gci.pszModule = m_szModuleName;
+
+ int count = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
+ for (int i = 0; i < count; i++)
+ {
+ gci.iItem = i;
+ if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
+ {
+ GCDEST gcd = { 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);
+ }
+ }
+}
+
+MCONTACT CSkypeProto::FindChatRoom(const char *chatname)
{
MCONTACT hContact = NULL;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
{
- ptrA cSkypename(getStringA(hContact, "ChatID"));
- if (mir_strcmpi(skypename, cSkypename) == 0)
+ if (!isChatRoom(hContact))
+ continue;
+
+ ptrA cChatname(getStringA(hContact, "ChatID"));
+ if (mir_strcmpi(chatname, cChatname) == 0)
break;
}
return hContact;
|