diff options
author | George Hazan <george.hazan@gmail.com> | 2015-02-09 14:03:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-02-09 14:03:33 +0000 |
commit | 9e791b8e15d0d5d8686436ed9eee010e670b858b (patch) | |
tree | a440a815c964d6a213e324c38aa287cc4a91f51b /protocols | |
parent | 326df8a13d865eccf3c3290c785ed92082574110 (diff) |
- fix for 'change subject' notifications;
- merge from branch
git-svn-id: http://svn.miranda-ng.org/main/trunk@12062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 1 | ||||
-rw-r--r-- | protocols/WhatsApp/src/dialogs.cpp | 62 |
2 files changed, 33 insertions, 30 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 40d9970751..1d5e59b00e 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -559,7 +559,6 @@ void WAConnection::parseNotification(ProtocolTreeNode *node) throw(WAException) ProtocolTreeNode *bodyNode = node->getChild("body");
if (bodyNode != NULL && m_pGroupEventHandler != NULL)
m_pGroupEventHandler->onGroupNewSubject(from, participant, bodyNode->getDataAsString(), ts);
- return; // don't set ack
}
ProtocolTreeNode sendNode("ack");
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index e482cdfa9d..67c12c7475 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -15,9 +15,7 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
SendDlgItemMessage(hwndDlg, IDC_PW, EM_LIMITTEXT, 3, 0);
SendDlgItemMessage(hwndDlg, IDC_PW2, EM_LIMITTEXT, 3, 0);
-
- CheckDlgButton(hwndDlg, IDC_SSL, proto->getBool(WHATSAPP_KEY_SSL, false) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTORUN, proto->getBool(WHATSAPP_KEY_AUTORUNCHATS, true) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SSL, db_get_b(NULL, proto->m_szModuleName, WHATSAPP_KEY_SSL, 0) ? BST_CHECKED : BST_UNCHECKED);
{
ptrA szStr(proto->getStringA(WHATSAPP_KEY_CC));
if (szStr != NULL)
@@ -83,23 +81,15 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA }
}
- if (HWND(lParam) == GetFocus()) {
- if (HIWORD(wParam) == EN_CHANGE) {
- switch (LOWORD(wParam)) {
- case IDC_CC:
- case IDC_LOGIN:
- case IDC_NICK:
- case IDC_PW:
- case IDC_PW2:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- else if (HIWORD(wParam) == BN_CLICKED) {
- switch (LOWORD(wParam)) {
- case IDC_AUTORUN:
- case IDC_SSL:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ if (HIWORD(wParam) == EN_CHANGE && reinterpret_cast<HWND>(lParam) == GetFocus()) {
+ switch (LOWORD(wParam)) {
+ case IDC_CC:
+ case IDC_LOGIN:
+ case IDC_NICK:
+ case IDC_SSL:
+ case IDC_PW:
+ case IDC_PW2:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
break;
@@ -118,7 +108,6 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA proto->setString(WHATSAPP_KEY_NICK, str);
proto->setByte(WHATSAPP_KEY_SSL, IsDlgButtonChecked(hwndDlg, IDC_SSL));
- proto->setByte(WHATSAPP_KEY_AUTORUNCHATS, IsDlgButtonChecked(hwndDlg, IDC_AUTORUN));
return TRUE;
}
break;
@@ -130,6 +119,16 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA /////////////////////////////////////////////////////////////////////////////////////////
// Invite dialog
+static void FilterList(HWND hwndClist, WhatsAppProto *ppro)
+{
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ char *proto = GetContactProto(hContact);
+ if (mir_strcmp(proto, ppro->m_szModuleName) || ppro->isChatRoom(hContact))
+ if (MCONTACT hItem = SendMessage(hwndClist, CLM_FINDCONTACT, hContact, 0))
+ SendMessage(hwndClist, CLM_DELETEITEM, hItem, 0);
+ }
+}
+
static void InitList(HWND hwndClist, WhatsAppProto *ppro)
{
SetWindowLongPtr(hwndClist, GWL_STYLE,
@@ -146,13 +145,8 @@ static void InitList(HWND hwndClist, WhatsAppProto *ppro) for (int i = 0; i <= FONTID_MAX; i++)
SendMessage(hwndClist, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
-
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- char *proto = GetContactProto(hContact);
- if (mir_strcmp(proto, ppro->m_szModuleName) || ppro->isChatRoom(hContact))
- if (MCONTACT hItem = SendMessage(hwndClist, CLM_FINDCONTACT, hContact, 0))
- SendMessage(hwndClist, CLM_DELETEITEM, hItem, 0);
- }
+
+ FilterList(hwndClist, ppro);
}
INT_PTR CALLBACK InviteDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -168,7 +162,17 @@ INT_PTR CALLBACK InviteDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM InitList(GetDlgItem(hwndDlg, IDC_CLIST), proto);
return 1;
-
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->idFrom == IDC_CLIST) {
+ switch (((LPNMHDR)lParam)->code) {
+ case CLN_LISTREBUILT:
+ case CLN_NEWCONTACT:
+ FilterList(((LPNMHDR)lParam)->hwndFrom, proto);
+ }
+ }
+ break;
+
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
|