diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-25 12:50:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-25 12:50:59 +0300 |
commit | 24a7f4bcff2953017070a7610ac3414984bcb0f9 (patch) | |
tree | 0ebab7b59ed9ff914a78e6a24757adb88775a564 /protocols | |
parent | 301a43aea0049f4e8573bda2b424528452e128c6 (diff) |
SkypeWeb: old useless code removed + code reordering
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_accounts.cpp | 23 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 94 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.cpp | 120 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.h | 56 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.cpp | 118 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.h | 53 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 33 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 8 |
8 files changed, 171 insertions, 334 deletions
diff --git a/protocols/SkypeWeb/src/skype_accounts.cpp b/protocols/SkypeWeb/src/skype_accounts.cpp deleted file mode 100644 index 0292468615..0000000000 --- a/protocols/SkypeWeb/src/skype_accounts.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/*
-Copyright (c) 2015-20 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-
-INT_PTR CSkypeProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)(CSkypeOptionsMain::CreateAccountManagerPage(this, (HWND)lParam))->GetHwnd();
-}
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 5afffbceac..718c6b55df 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -81,7 +81,35 @@ void CSkypeProto::OnLoadChats(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) }
}
-/* Hooks */
+/////////////////////////////////////////////////////////////////////////////////////////
+// Group chat invitation dialog
+
+class CSkypeInviteDlg : public CSkypeDlgBase
+{
+ CCtrlCombo m_combo;
+
+public:
+ MCONTACT m_hContact = 0;
+
+ CSkypeInviteDlg(CSkypeProto *proto) :
+ CSkypeDlgBase(proto, IDD_GC_INVITE),
+ m_combo(this, IDC_CONTACT)
+ {}
+
+ bool OnInitDialog() override
+ {
+ for (auto &hContact : m_proto->AccContacts())
+ if (!m_proto->isChatRoom(hContact))
+ m_combo.AddString(Clist_GetContactDisplayName(hContact), hContact);
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ m_hContact = m_combo.GetItemData(m_combo.GetCurSel());
+ return true;
+ }
+};
int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam)
{
@@ -460,6 +488,70 @@ void CSkypeProto::RemoveChatContact(const char *chat_id, const char *id, const c Chat_Event(&gce);
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Group chat creation dialog
+
+class CSkypeGCCreateDlg : public CSkypeDlgBase
+{
+ CCtrlClc m_clc;
+
+public:
+ LIST<char> m_ContactsList;
+
+ CSkypeGCCreateDlg(CSkypeProto *proto) :
+ CSkypeDlgBase(proto, IDD_GC_CREATE),
+ m_clc(this, IDC_CLIST),
+ m_ContactsList(1)
+ {
+ m_clc.OnListRebuilt = Callback(this, &CSkypeGCCreateDlg::FilterList);
+ }
+
+ ~CSkypeGCCreateDlg()
+ {
+ CSkypeProto::FreeList(m_ContactsList);
+ m_ContactsList.destroy();
+ }
+
+ bool OnInitDialog() override
+ {
+ SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
+ GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE);
+ m_clc.SendMsg(CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
+
+ ResetListOptions(&m_clc);
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ for (auto &hContact : m_proto->AccContacts()) {
+ if (!m_proto->isChatRoom(hContact))
+ if (HANDLE hItem = m_clc.FindContact(hContact))
+ if (m_clc.GetCheck(hItem))
+ m_ContactsList.insert(m_proto->getId(hContact).Detach());
+ }
+
+ m_ContactsList.insert(m_proto->m_szSkypename.GetBuffer());
+ return true;
+ }
+
+ void FilterList(CCtrlClc *)
+ {
+ for (auto &hContact : Contacts()) {
+ char *proto = Proto_GetBaseAccountName(hContact);
+ if (mir_strcmp(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact))
+ if (HANDLE hItem = m_clc.FindContact(hContact))
+ m_clc.DeleteItem(hItem);
+ }
+ }
+
+ void ResetListOptions(CCtrlClc *)
+ {
+ m_clc.SetHideEmptyGroups(true);
+ m_clc.SetHideOfflineRoot(true);
+ }
+};
+
INT_PTR CSkypeProto::SvcCreateChat(WPARAM, LPARAM)
{
if (IsOnline()) {
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp deleted file mode 100644 index d64e20c81f..0000000000 --- a/protocols/SkypeWeb/src/skype_dialogs.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/*
-Copyright (c) 2015-20 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-
-void CSkypeProto::CloseDialogs()
-{
- for (auto &it : m_GCCreateDialogs)
- it->Close();
-
- for (auto &it : m_InviteDialogs)
- it->Close();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CSkypeInvideDlg
-
-CSkypeInviteDlg::CSkypeInviteDlg(CSkypeProto *proto) :
- CSkypeDlgBase(proto, IDD_GC_INVITE),
- m_combo(this, IDC_CONTACT)
-{
-}
-
-bool CSkypeInviteDlg::OnInitDialog()
-{
- m_proto->m_InviteDialogs.insert(this);
-
- for (auto &hContact : m_proto->AccContacts())
- if (!m_proto->isChatRoom(hContact))
- m_combo.AddString(Clist_GetContactDisplayName(hContact), hContact);
- return true;
-}
-
-bool CSkypeInviteDlg::OnApply()
-{
- m_hContact = m_combo.GetItemData(m_combo.GetCurSel());
- return true;
-}
-
-void CSkypeInviteDlg::OnDestroy()
-{
- m_proto->m_InviteDialogs.remove(this);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CSkypeGCCreateDlg
-
-CSkypeGCCreateDlg::CSkypeGCCreateDlg(CSkypeProto *proto) :
- CSkypeDlgBase(proto, IDD_GC_CREATE),
- m_clc(this, IDC_CLIST),
- m_ContactsList(1)
-{
- m_clc.OnListRebuilt = Callback(this, &CSkypeGCCreateDlg::FilterList);
-}
-
-CSkypeGCCreateDlg::~CSkypeGCCreateDlg()
-{
- CSkypeProto::FreeList(m_ContactsList);
- m_ContactsList.destroy();
-}
-
-bool CSkypeGCCreateDlg::OnInitDialog()
-{
- m_proto->m_GCCreateDialogs.insert(this);
-
- SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
- GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE);
- m_clc.SendMsg(CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
-
- ResetListOptions(&m_clc);
- return true;
-}
-
-bool CSkypeGCCreateDlg::OnApply()
-{
- for (auto &hContact : m_proto->AccContacts()) {
- if (!m_proto->isChatRoom(hContact))
- if (HANDLE hItem = m_clc.FindContact(hContact))
- if (m_clc.GetCheck(hItem))
- m_ContactsList.insert(m_proto->getId(hContact).Detach());
- }
-
- m_ContactsList.insert(m_proto->m_szSkypename.GetBuffer());
- return true;
-}
-
-void CSkypeGCCreateDlg::OnDestroy()
-{
- m_proto->m_GCCreateDialogs.remove(this);
-}
-
-void CSkypeGCCreateDlg::FilterList(CCtrlClc *)
-{
- for (auto &hContact : Contacts()) {
- char *proto = Proto_GetBaseAccountName(hContact);
- if (mir_strcmp(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact))
- if (HANDLE hItem = m_clc.FindContact(hContact))
- m_clc.DeleteItem(hItem);
- }
-}
-
-void CSkypeGCCreateDlg::ResetListOptions(CCtrlClc *)
-{
- m_clc.SetHideEmptyGroups(true);
- m_clc.SetHideOfflineRoot(true);
-}
diff --git a/protocols/SkypeWeb/src/skype_dialogs.h b/protocols/SkypeWeb/src/skype_dialogs.h deleted file mode 100644 index 942128d692..0000000000 --- a/protocols/SkypeWeb/src/skype_dialogs.h +++ /dev/null @@ -1,56 +0,0 @@ -/*
-Copyright (c) 2015-20 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _SKYPE_DIALOGS_H_
-#define _SKYPE_DIALOGS_H_
-
-typedef CProtoDlgBase<CSkypeProto> CSkypeDlgBase;
-
-class CSkypeInviteDlg : public CSkypeDlgBase
-{
- CCtrlCombo m_combo;
-
-public:
- CSkypeInviteDlg(CSkypeProto *proto);
-
- bool OnInitDialog() override;
- bool OnApply() override;
- void OnDestroy() override;
-
- MCONTACT m_hContact = 0;
-};
-
-class CSkypeGCCreateDlg : public CSkypeDlgBase
-{
- CCtrlClc m_clc;
-
-public:
- CSkypeGCCreateDlg(CSkypeProto *proto);
- ~CSkypeGCCreateDlg();
-
- bool OnInitDialog() override;
- bool OnApply() override;
- void OnDestroy() override;
-
- void FilterList(CCtrlClc*);
- void ResetListOptions(CCtrlClc*);
-
- LIST<char> m_ContactsList;
-};
-
-
-#endif //_SKYPE_DIALOGS_H_
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index c1d4ecabbc..18d92d9feb 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -17,58 +17,79 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-CSkypeOptionsMain::CSkypeOptionsMain(CSkypeProto *proto, int idDialog)
- : CSkypeDlgBase(proto, idDialog),
- m_skypename(this, IDC_SKYPENAME),
- m_password(this, IDC_PASSWORD),
- m_group(this, IDC_GROUP),
- m_place(this, IDC_PLACE),
- m_autosync(this, IDC_AUTOSYNC),
- m_allasunread(this, IDC_MESASUREAD),
- m_usehostname(this, IDC_USEHOST),
- m_usebb(this, IDC_BBCODES),
- m_link(this, IDC_CHANGEPASS, "https://login.skype.com/recovery/password-change") // TODO : ...?username=%username%
+class CSkypeOptionsMain : public CSkypeDlgBase
{
- CreateLink(m_group, proto->m_opts.wstrCListGroup);
- CreateLink(m_autosync, proto->m_opts.bAutoHistorySync);
- CreateLink(m_allasunread, proto->m_opts.bMarkAllAsUnread);
- CreateLink(m_place, proto->m_opts.wstrPlace);
- CreateLink(m_usehostname, proto->m_opts.bUseHostnameAsPlace);
- CreateLink(m_usebb, proto->m_opts.bUseBBCodes);
- m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
-}
+ CCtrlEdit m_skypename, m_password, m_group, m_place;
+ CCtrlCheck m_autosync, m_allasunread, m_usehostname, m_usebb;
+ CCtrlHyperlink m_link;
-bool CSkypeOptionsMain::OnInitDialog()
-{
- CSkypeDlgBase::OnInitDialog();
+public:
+ CSkypeOptionsMain(CSkypeProto *proto, int idDialog) :
+ CSkypeDlgBase(proto, idDialog),
+ m_skypename(this, IDC_SKYPENAME),
+ m_password(this, IDC_PASSWORD),
+ m_group(this, IDC_GROUP),
+ m_place(this, IDC_PLACE),
+ m_autosync(this, IDC_AUTOSYNC),
+ m_allasunread(this, IDC_MESASUREAD),
+ m_usehostname(this, IDC_USEHOST),
+ m_usebb(this, IDC_BBCODES),
+ m_link(this, IDC_CHANGEPASS, "https://login.skype.com/recovery/password-change") // TODO : ...?username=%username%
+ {
+ CreateLink(m_group, proto->m_opts.wstrCListGroup);
+ CreateLink(m_autosync, proto->m_opts.bAutoHistorySync);
+ CreateLink(m_allasunread, proto->m_opts.bMarkAllAsUnread);
+ CreateLink(m_place, proto->m_opts.wstrPlace);
+ CreateLink(m_usehostname, proto->m_opts.bUseHostnameAsPlace);
+ CreateLink(m_usebb, proto->m_opts.bUseBBCodes);
+ m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
+ }
- m_skypename.SetTextA(ptrA(m_proto->getStringA(SKYPE_SETTINGS_ID)));
- m_password.SetTextA(pass_ptrA(m_proto->getStringA("Password")));
- m_place.Enable(!m_proto->m_opts.bUseHostnameAsPlace);
- m_skypename.SendMsg(EM_LIMITTEXT, 128, 0);
- m_password.SendMsg(EM_LIMITTEXT, 128, 0);
- m_group.SendMsg(EM_LIMITTEXT, 64, 0);
- return true;
-}
+ bool OnInitDialog() override
+ {
+ CSkypeDlgBase::OnInitDialog();
-bool CSkypeOptionsMain::OnApply()
-{
- ptrA szNewSkypename(m_skypename.GetTextA()),
- szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID));
- pass_ptrA szNewPassword(m_password.GetTextA()),
- szOldPassword(m_proto->getStringA("Password"));
- if (mir_strcmpi(szNewSkypename, szOldSkypename) || mir_strcmp(szNewPassword, szOldPassword))
- m_proto->delSetting("TokenExpiresIn");
- m_proto->setString(SKYPE_SETTINGS_ID, szNewSkypename);
- m_proto->setString("Password", szNewPassword);
- ptrW group(m_group.GetText());
- if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group))
- Clist_GroupCreate(0, group);
- return true;
-}
+ m_skypename.SetTextA(ptrA(m_proto->getStringA(SKYPE_SETTINGS_ID)));
+ m_password.SetTextA(pass_ptrA(m_proto->getStringA("Password")));
+ m_place.Enable(!m_proto->m_opts.bUseHostnameAsPlace);
+ m_skypename.SendMsg(EM_LIMITTEXT, 128, 0);
+ m_password.SendMsg(EM_LIMITTEXT, 128, 0);
+ m_group.SendMsg(EM_LIMITTEXT, 64, 0);
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ ptrA szNewSkypename(m_skypename.GetTextA()),
+ szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID));
+ pass_ptrA szNewPassword(m_password.GetTextA()),
+ szOldPassword(m_proto->getStringA("Password"));
+ if (mir_strcmpi(szNewSkypename, szOldSkypename) || mir_strcmp(szNewPassword, szOldPassword))
+ m_proto->delSetting("TokenExpiresIn");
+ m_proto->setString(SKYPE_SETTINGS_ID, szNewSkypename);
+ m_proto->setString("Password", szNewPassword);
+ ptrW group(m_group.GetText());
+ if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group))
+ Clist_GroupCreate(0, group);
+ return true;
+ }
+
+ void OnUsehostnameCheck(CCtrlCheck *)
+ {
+ m_place.Enable(!m_usehostname.GetState());
+ }
+};
/////////////////////////////////////////////////////////////////////////////////
+INT_PTR CSkypeProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
+{
+ auto *pDlg = new CSkypeOptionsMain(this, IDD_ACCOUNT_MANAGER);
+ pDlg->SetParent(HWND(lParam));
+ pDlg->Show();
+ return (INT_PTR)pDlg->GetHwnd();
+}
+
int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
@@ -77,13 +98,8 @@ int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.szGroup.w = LPGENW("Network");
odp.szTab.w = LPGENW("Account");
- odp.pDialog = CSkypeOptionsMain::CreateOptionsPage(this);
+ odp.pDialog = new CSkypeOptionsMain(this, IDD_OPTIONS_MAIN);
g_plugin.addOptions(wParam, &odp);
return 0;
}
-
-void CSkypeOptionsMain::OnUsehostnameCheck(CCtrlCheck*)
-{
- m_place.Enable(!m_usehostname.GetState());
-}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_options.h b/protocols/SkypeWeb/src/skype_options.h deleted file mode 100644 index 3859ab2b84..0000000000 --- a/protocols/SkypeWeb/src/skype_options.h +++ /dev/null @@ -1,53 +0,0 @@ -/*
-Copyright (c) 2015-20 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _SKYPE_OPTIONS_H_
-#define _SKYPE_OPTIONS_H_
-
-class CSkypeOptionsMain : public CSkypeDlgBase
-{
-private:
- CCtrlEdit m_skypename;
- CCtrlEdit m_password;
- CCtrlEdit m_group;
- CCtrlEdit m_place;
- CCtrlCheck m_autosync;
- CCtrlCheck m_allasunread;
- CCtrlCheck m_usehostname;
- CCtrlCheck m_usebb;
- CCtrlHyperlink m_link;
-
-protected:
- CSkypeOptionsMain(CSkypeProto *proto, int idDialog);
-
- bool OnInitDialog() override;
- bool OnApply() override;
- void OnUsehostnameCheck(CCtrlCheck*);
-
-public:
- static CDlgBase *CreateAccountManagerPage(void *param, HWND owner)
- {
- CSkypeOptionsMain *page = new CSkypeOptionsMain((CSkypeProto*)param, IDD_ACCOUNT_MANAGER);
- page->SetParent(owner);
- page->Show();
- return page;
- }
-
- static CDlgBase *CreateOptionsPage(void *param) { return new CSkypeOptionsMain((CSkypeProto*)param, IDD_OPTIONS_MAIN); }
-};
-
-#endif //_SKYPE_OPTIONS_H_
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index eddaa3d9a3..9be4467492 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) : PROTO<CSkypeProto>(protoName, userName), m_PopupClasses(1), - m_InviteDialogs(1), - m_GCCreateDialogs(1), m_OutMessages(3, PtrKeySortT), m_bThreadsTerminated(false), m_opts(this), @@ -239,21 +237,11 @@ int CSkypeProto::SetStatus(int iNewStatus) return 0; switch (iNewStatus) { - case ID_STATUS_FREECHAT: - iNewStatus = ID_STATUS_ONLINE; - break; - - case ID_STATUS_NA: - iNewStatus = ID_STATUS_AWAY; - break; - - case ID_STATUS_OCCUPIED: - iNewStatus = ID_STATUS_DND; - break; + case ID_STATUS_FREECHAT: iNewStatus = ID_STATUS_ONLINE; break; + case ID_STATUS_NA: iNewStatus = ID_STATUS_AWAY; break; + case ID_STATUS_OCCUPIED: iNewStatus = ID_STATUS_DND; break; } - //mir_cslock lck(m_StatusLock); - debugLogA(__FUNCTION__ ": changing status from %i to %i", m_iStatus, iNewStatus); int old_status = m_iStatus; @@ -267,7 +255,6 @@ int CSkypeProto::SetStatus(int iNewStatus) // logout StopQueue(); - CloseDialogs(); ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, ID_STATUS_OFFLINE); m_impl.m_heartBeat.StopSafe(); @@ -299,22 +286,20 @@ int CSkypeProto::UserIsTyping(MCONTACT hContact, int type) int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) { PROTOSEARCHRESULT **isrList = (PROTOSEARCHRESULT**)pre->szMessage; - DWORD cbBlob = 0; - BYTE *pBlob; - BYTE *pCurBlob; - int i; int nCount = *((LPARAM*)pre->lParam); char* szMessageId = ((char*)pre->lParam + sizeof(LPARAM)); //if (GetMessageFromDb(hContact, szMessageId, pre->timestamp)) return 0; - for (i = 0; i < nCount; i++) + DWORD cbBlob = 0; + for (int i = 0; i < nCount; i++) cbBlob += int(/*mir_wstrlen(isrList[i]->nick.w)*/0 + 2 + mir_wstrlen(isrList[i]->id.w) + mir_strlen(szMessageId)); - pBlob = (PBYTE)mir_calloc(cbBlob); + BYTE *pBlob = (PBYTE)mir_calloc(cbBlob); + BYTE *pCurBlob = pBlob; - for (i = 0, pCurBlob = pBlob; i < nCount; i++) { + for (int i = 0; i < nCount; i++) { //mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w)); pCurBlob += mir_strlen((PCHAR)pCurBlob) + 1; @@ -322,8 +307,6 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) pCurBlob += mir_strlen((char*)pCurBlob) + 1; } - // memcpy(pCurBlob + 1, szMessageId, mir_strlen(szMessageId)); - DBEVENTINFO dbei = {}; dbei.szModule = m_szModuleName; dbei.timestamp = pre->timestamp; diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index bb1f42fd2f..343149dd4c 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -158,10 +158,6 @@ private: LIST<void> m_PopupClasses;
LIST<void> m_OutMessages;
- // dialogs
- LIST<CSkypeInviteDlg> m_InviteDialogs;
- LIST<CSkypeGCCreateDlg> m_GCCreateDialogs;
-
// locks
mir_cs m_lckOutMessagesList;
mir_cs messageSyncLock;
@@ -341,7 +337,7 @@ private: CMStringW RunConfirmationCode();
CMStringW ChangeTopicForm();
- void CloseDialogs();
+
//events
void InitDBEvents();
@@ -363,4 +359,6 @@ private: }
};
+typedef CProtoDlgBase<CSkypeProto> CSkypeDlgBase;
+
#endif //_SKYPE_PROTO_H_
\ No newline at end of file |