diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-15 19:53:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-15 19:53:39 +0300 |
commit | d2dab81d17eafa10fb55b675090f6110ff7f7930 (patch) | |
tree | 9622499649ccb0ddc98e88260342e41e7289343d /protocols/Facebook/src | |
parent | efbd3e90b66f16d3aac1d99f15ce7f2f83477b4e (diff) |
fixes #1012 (Facebook: option needed to load friends only)
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 | 13 | ||||
-rw-r--r-- | protocols/Facebook/src/resource.h | 3 | ||||
-rw-r--r-- | protocols/Facebook/src/server.cpp | 3 |
5 files changed, 15 insertions, 9 deletions
diff --git a/protocols/Facebook/src/options.cpp b/protocols/Facebook/src/options.cpp index 114db861d1..ddfd177552 100644 --- a/protocols/Facebook/src/options.cpp +++ b/protocols/Facebook/src/options.cpp @@ -23,18 +23,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class CFacebookAccOptsDlg : public CFBDlgBase { CCtrlEdit edtGroup; - CCtrlCheck chkEnableChats, chkHideChats, chkKeepUnread, chkLoginInvis; + CCtrlCheck chkEnableChats, chkHideChats, chkKeepUnread, chkLoginInvis, chkLoadAll; public: CFacebookAccOptsDlg(FacebookProto *pThis) : CFBDlgBase(pThis, IDD_OPTIONS), edtGroup(this, IDC_GROUP), + chkLoadAll(this, IDC_LOADALL), chkHideChats(this, IDC_HIDECHATS), chkKeepUnread(this, IDC_KEEP_UNREAD), chkLoginInvis(this, IDC_INVIS_LOGIN), chkEnableChats(this, IDC_ENABLECHATS) { CreateLink(edtGroup, pThis->m_wszDefaultGroup); + CreateLink(chkLoadAll, pThis->m_bLoadAll); CreateLink(chkHideChats, pThis->m_bHideGroupchats); CreateLink(chkKeepUnread, pThis->m_bKeepUnread); CreateLink(chkLoginInvis, pThis->m_bLoginInvisible); diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp index 51d9f82ecd..6b97d82ae3 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_bLoadAll(this, "LoadAllContacts", false), m_bKeepUnread(this, "KeepUnread", false), m_bUseBigAvatars(this, "UseBigAvatars", true), m_bUseGroupchats(this, "UseGroupChats", true), diff --git a/protocols/Facebook/src/proto.h b/protocols/Facebook/src/proto.h index 1df80c6e4d..6ae38f2ca1 100644 --- a/protocols/Facebook/src/proto.h +++ b/protocols/Facebook/src/proto.h @@ -498,12 +498,13 @@ public: ////////////////////////////////////////////////////////////////////////////////////// // options - CMOption<wchar_t *> m_wszDefaultGroup; // clist group to store contacts - CMOption<bool> m_bUseBigAvatars; // use big or small avatars by default - CMOption<bool> m_bUseGroupchats; // do we need group chats at all? - CMOption<bool> m_bHideGroupchats; // do not open chat windows on creation - CMOption<bool> m_bLoginInvisible; // login in the invisible mode - CMOption<bool> m_bKeepUnread; // do not mark incoming messages as read + CMOption<wchar_t *> m_wszDefaultGroup; // clist group to store contacts + CMOption<bool> m_bUseBigAvatars; // use big or small avatars by default + CMOption<bool> m_bUseGroupchats; // do we need group chats at all? + CMOption<bool> m_bHideGroupchats; // do not open chat windows on creation + CMOption<bool> m_bLoginInvisible; // login in the invisible mode + CMOption<bool> m_bKeepUnread; // do not mark incoming messages as read + CMOption<bool> m_bLoadAll; // load all contacts, not only those who have ARE_FRIENDS status //////////////////////////////////////////////////////////////////////////////////////// // PROTO_INTERFACE diff --git a/protocols/Facebook/src/resource.h b/protocols/Facebook/src/resource.h index 3cf940682e..806f550e5e 100644 --- a/protocols/Facebook/src/resource.h +++ b/protocols/Facebook/src/resource.h @@ -16,6 +16,7 @@ #define IDC_CLIST 1007 #define IDC_KEEP_UNREAD 1008 #define IDC_INVIS_LOGIN 1009 +#define IDC_LOADALL 1010 // Next default values for new objects // @@ -23,7 +24,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1009 +#define _APS_NEXT_CONTROL_VALUE 1011 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index deca30a243..96f159f5de 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -137,6 +137,7 @@ int FacebookProto::RefreshContacts() return iErrorCode; // unknown error bool bNeedUpdate = false; + bool bLoadAll = m_bLoadAll; for (auto &it : reply.data()["viewer"]["messenger_contacts"]["nodes"]) { auto &n = it["represented_profile"]; @@ -145,7 +146,7 @@ int FacebookProto::RefreshContacts() MCONTACT hContact; if (id != m_uid) { - bool bIsFriend = n["friendship_status"].as_mstring() == L"ARE_FRIENDS"; + bool bIsFriend = bLoadAll || n["friendship_status"].as_mstring() == L"ARE_FRIENDS"; auto *pUser = FindUser(id); if (pUser == nullptr) { |