summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-02-12 19:22:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-02-12 19:22:08 +0300
commitc41c8a91db4285a9e7ce0da1be715f67be97ad3b (patch)
tree23900d8b607c2512f32a5189ff417e2e3153df46 /protocols
parent7c41ebba4f0c04a4a779ac0698027ec738cac0ea (diff)
Facebook: restored option to keep messages unread at the server
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Facebook/res/facebook.rc13
-rw-r--r--protocols/Facebook/src/options.cpp4
-rw-r--r--protocols/Facebook/src/proto.cpp1
-rw-r--r--protocols/Facebook/src/proto.h1
-rw-r--r--protocols/Facebook/src/resource.h3
-rw-r--r--protocols/Facebook/src/server.cpp3
-rw-r--r--protocols/Facebook/src/version.h2
7 files changed, 19 insertions, 8 deletions
diff --git a/protocols/Facebook/res/facebook.rc b/protocols/Facebook/res/facebook.rc
index 5044c073ae..97ca037f3d 100644
--- a/protocols/Facebook/res/facebook.rc
+++ b/protocols/Facebook/res/facebook.rc
@@ -72,7 +72,7 @@ BEGIN
"Hyperlink",WS_TABSTOP,6,40,172,12
END
-IDD_OPTIONS DIALOGEX 0, 0, 305, 195
+IDD_OPTIONS DIALOGEX 0, 0, 305, 166
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -84,13 +84,15 @@ BEGIN
EDITTEXT IDC_PW,84,34,123,13,ES_PASSWORD | ES_AUTOHSCROLL
CONTROL "Create a new Facebook account",IDC_NEWACCOUNTLINK,
"Hyperlink",WS_TABSTOP,84,53,189,10
- GROUPBOX "Contacts",IDC_STATIC,7,70,291,31
+ GROUPBOX "Contacts",IDC_STATIC,7,70,291,45
LTEXT "Default group:",IDC_STATIC,17,84,61,8,0,WS_EX_RIGHT
EDITTEXT IDC_GROUP,84,82,123,13,ES_AUTOHSCROLL
- GROUPBOX "Group chats",IDC_STATIC,7,103,291,44
- CONTROL "Enable group chats",IDC_ENABLECHATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,117,277,10
+ CONTROL "Keep messages as unread on server",IDC_KEEP_UNREAD,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,99,277,10
+ GROUPBOX "Group chats",IDC_STATIC,7,116,291,44
+ CONTROL "Enable group chats",IDC_ENABLECHATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,130,277,10
CONTROL "Do not open chat windows on creation",IDC_HIDECHATS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,130,277,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,143,277,10
END
IDD_GROUPCHAT_INVITE DIALOGEX 0, 0, 215, 263
@@ -103,6 +105,7 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,158,243,50,14
END
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
diff --git a/protocols/Facebook/src/options.cpp b/protocols/Facebook/src/options.cpp
index cb353caf70..9c55f42b20 100644
--- a/protocols/Facebook/src/options.cpp
+++ b/protocols/Facebook/src/options.cpp
@@ -23,17 +23,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class CFacebookAccOptsDlg : public CFBDlgBase
{
CCtrlEdit edtGroup;
- CCtrlCheck chkEnableChats, chkHideChats;
+ CCtrlCheck chkEnableChats, chkHideChats, chkKeepUnread;
public:
CFacebookAccOptsDlg(FacebookProto *pThis) :
CFBDlgBase(pThis, IDD_OPTIONS),
edtGroup(this, IDC_GROUP),
chkHideChats(this, IDC_HIDECHATS),
+ chkKeepUnread(this, IDC_KEEP_UNREAD),
chkEnableChats(this, IDC_ENABLECHATS)
{
CreateLink(edtGroup, pThis->m_wszDefaultGroup);
CreateLink(chkHideChats, pThis->m_bUseGroupchats);
+ CreateLink(chkKeepUnread, pThis->m_bKeepUnread);
CreateLink(chkEnableChats, pThis->m_bHideGroupchats);
}
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index a2accdb471..ff307986a9 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -41,6 +41,7 @@ FacebookProto::FacebookProto(const char *proto_name, const wchar_t *username) :
m_impl(*this),
m_users(50, CompareUsers),
arOwnMessages(1, CompareMessages),
+ m_bKeepUnread(this, "KeepUnread", false),
m_bUseBigAvatars(this, "UseBigAvatars", true),
m_bUseGroupchats(this, "UseGroupChats", true),
m_bHideGroupchats(this, "HideGroupChats", true),
diff --git a/protocols/Facebook/src/proto.h b/protocols/Facebook/src/proto.h
index 050e93f356..95be0e2696 100644
--- a/protocols/Facebook/src/proto.h
+++ b/protocols/Facebook/src/proto.h
@@ -495,6 +495,7 @@ public:
CMOption<BYTE> m_bUseBigAvatars; // use big or small avatars by default
CMOption<BYTE> m_bUseGroupchats; // do we need group chats at all?
CMOption<BYTE> m_bHideGroupchats; // do not open chat windows on creation
+ CMOption<bool> m_bKeepUnread; // do not mark incoming messages as read
////////////////////////////////////////////////////////////////////////////////////////
// PROTO_INTERFACE
diff --git a/protocols/Facebook/src/resource.h b/protocols/Facebook/src/resource.h
index b0819aeff8..a83aa158a8 100644
--- a/protocols/Facebook/src/resource.h
+++ b/protocols/Facebook/src/resource.h
@@ -14,6 +14,7 @@
#define IDC_ENABLECHATS 1005
#define IDC_HIDECHATS 1006
#define IDC_CLIST 1007
+#define IDC_KEEP_UNREAD 1008
// Next default values for new objects
//
@@ -21,7 +22,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1008
+#define _APS_NEXT_CONTROL_VALUE 1009
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp
index f9d2eb5b2f..b4adb46d35 100644
--- a/protocols/Facebook/src/server.cpp
+++ b/protocols/Facebook/src/server.cpp
@@ -358,6 +358,9 @@ int FacebookProto::OnMarkedRead(WPARAM, LPARAM hDbEvent)
if (mir_strcmp(szProto, m_szModuleName))
return 0;
+ if (m_bKeepUnread)
+ return 0;
+
JSONNode root; root << BOOL_PARAM("state", true) << INT_PARAM("syncSeqId", m_sid) << CHAR_PARAM("mark", "read");
if (isChatRoom(hContact))
root << CHAR_PARAM("threadFbId", getMStringA(hContact, DBKEY_ID));
diff --git a/protocols/Facebook/src/version.h b/protocols/Facebook/src/version.h
index 0b5d8f4732..95ece08775 100644
--- a/protocols/Facebook/src/version.h
+++ b/protocols/Facebook/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>