diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-12 19:22:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-12 19:22:08 +0300 |
commit | c41c8a91db4285a9e7ce0da1be715f67be97ad3b (patch) | |
tree | 23900d8b607c2512f32a5189ff417e2e3153df46 /protocols/Facebook/src | |
parent | 7c41ebba4f0c04a4a779ac0698027ec738cac0ea (diff) |
Facebook: restored option to keep messages unread at the server
Diffstat (limited to 'protocols/Facebook/src')
-rw-r--r-- | protocols/Facebook/src/options.cpp | 4 | ||||
-rw-r--r-- | protocols/Facebook/src/proto.cpp | 1 | ||||
-rw-r--r-- | protocols/Facebook/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/Facebook/src/resource.h | 3 | ||||
-rw-r--r-- | protocols/Facebook/src/server.cpp | 3 | ||||
-rw-r--r-- | protocols/Facebook/src/version.h | 2 |
6 files changed, 11 insertions, 3 deletions
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> |