diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-07-15 21:38:32 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-07-15 21:38:32 +0000 |
commit | 24145eb51f09d7f97c7ed3725bacb552130b9da0 (patch) | |
tree | f4a675eab4579402cd270589ca036ac547ec4dc2 /protocols/FacebookRM | |
parent | 10a205a4c77765d6300e16e3b202dfef97a3e45c (diff) |
Facebook: Option to not open chats on creaton
git-svn-id: http://svn.miranda-ng.org/main/trunk@9819 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/res/facebook.rc | 40 | ||||
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/constants.h | 1 | ||||
-rw-r--r-- | protocols/FacebookRM/src/db.h | 1 | ||||
-rw-r--r-- | protocols/FacebookRM/src/dialogs.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/resource.h | 1 |
6 files changed, 30 insertions, 21 deletions
diff --git a/protocols/FacebookRM/res/facebook.rc b/protocols/FacebookRM/res/facebook.rc index fba81488a7..97fccc36a7 100644 --- a/protocols/FacebookRM/res/facebook.rc +++ b/protocols/FacebookRM/res/facebook.rc @@ -139,38 +139,40 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,121,272,8
END
-IDD_OPTIONS_ADVANCED DIALOGEX 0, 0, 305, 227
+IDD_OPTIONS_ADVANCED DIALOGEX 0, 0, 305, 237
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- GROUPBOX "Advanced Settings",IDC_STATIC,7,7,291,111
+ GROUPBOX "Advanced Settings",IDC_STATIC,7,7,291,104
CONTROL "Force secure (HTTPS) connection",IDC_SECURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,22,267,10
- CONTROL "Post Miranda statuses to Wall",IDC_SET_STATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,17,46,267,10
+ CONTROL "Post Miranda statuses to Wall",IDC_SET_STATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,17,44,267,10
CONTROL "Use secure connection also for channel requests",IDC_SECURE_CHANNEL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,32,34,252,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,32,33,252,10
CONTROL "Also disconnect chat when going to offline",IDC_DISCONNECT_CHAT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,58,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,55,267,10
CONTROL "Map non-standard statuses to Invisible (instead of Online)",IDC_MAP_STATUSES,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,71,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,67,267,10
CONTROL "Allow posting statuses to my pages (may slow down login)",IDC_LOAD_PAGES,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,84,267,10
- RTEXT "Use this server for opening links:",IDC_STATIC,17,100,135,8
- COMBOBOX IDC_URL_SERVER,156,97,128,59,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,79,267,10
+ RTEXT "Use this server for opening links:",IDC_STATIC,17,94,135,8
+ COMBOBOX IDC_URL_SERVER,156,91,128,59,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Enable support for Custom smileys (EXPERIMENTAL + BUGGY!)",IDC_CUSTOM_SMILEYS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,136,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,129,267,10
CONTROL "Use local time for received messages",IDC_USE_LOCAL_TIME,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,150,267,10
- GROUPBOX "Message sessions",IDC_STATIC,7,121,291,98
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,142,267,10
+ GROUPBOX "Message sessions",IDC_STATIC,7,114,291,111
CONTROL "Keep messages as unread on server (don't send ""seen"" info)",IDC_KEEP_UNREAD,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,164,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,155,267,10
CONTROL "Receive messages from ""inbox"" folder only",IDC_INBOX_ONLY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,178,267,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,168,267,10
CONTROL "Load last messages on opening message window (EXPERIMENTAL)",IDC_MESSAGES_ON_OPEN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,192,267,10
- RTEXT "Number of messages to load:",IDC_STATIC,17,206,135,8
- EDITTEXT IDC_MESSAGES_COUNT,156,203,34,14,ES_AUTOHSCROLL
- CONTROL "",IDC_MESSAGES_COUNT_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,190,203,11,14
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,181,267,10
+ RTEXT "Number of messages to load:",IDC_STATIC,17,195,135,8
+ EDITTEXT IDC_MESSAGES_COUNT,156,192,34,14,ES_AUTOHSCROLL
+ CONTROL "",IDC_MESSAGES_COUNT_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,190,192,11,14
+ CONTROL "Do not open chat windows on creation ",IDC_HIDE_CHATS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,210,267,10
END
@@ -240,7 +242,7 @@ BEGIN VERTGUIDE, 156
VERTGUIDE, 284
TOPMARGIN, 7
- BOTTOMMARGIN, 220
+ BOTTOMMARGIN, 230
END
END
#endif // APSTUDIO_INVOKED
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index ac909fa2ee..872485107e 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -235,10 +235,12 @@ void FacebookProto::AddChat(const TCHAR *tid, const TCHAR *tname) gce.time = ::time(NULL);
gce.pDest = &gcd;
+ bool hideChats = getBool(FACEBOOK_KEY_HIDE_CHATS, DEFAULT_HIDE_CHATS);
+
// Add self contact
AddChatContact(tid, facy.self_.user_id.c_str(), facy.self_.real_name.c_str());
- CallServiceSync(MS_GC_EVENT,SESSION_INITDONE,reinterpret_cast<LPARAM>(&gce));
- CallServiceSync(MS_GC_EVENT,SESSION_ONLINE, reinterpret_cast<LPARAM>(&gce));
+ CallServiceSync(MS_GC_EVENT, (hideChats ? WINDOW_HIDDEN : SESSION_INITDONE), reinterpret_cast<LPARAM>(&gce));
+ CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, reinterpret_cast<LPARAM>(&gce));
}
INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM suppress)
diff --git a/protocols/FacebookRM/src/constants.h b/protocols/FacebookRM/src/constants.h index fa1fa24dfe..a0b29ad867 100644 --- a/protocols/FacebookRM/src/constants.h +++ b/protocols/FacebookRM/src/constants.h @@ -81,6 +81,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define DEFAULT_FILTER_ADS 0
#define DEFAULT_MESSAGES_ON_OPEN 0
#define DEFAULT_MESSAGES_ON_OPEN_COUNT 10
+#define DEFAULT_HIDE_CHATS 0
#define DEFAULT_EVENT_NOTIFICATIONS_ENABLE 1
#define DEFAULT_EVENT_FEEDS_ENABLE 1
diff --git a/protocols/FacebookRM/src/db.h b/protocols/FacebookRM/src/db.h index 834f7e7a74..d395bec813 100644 --- a/protocols/FacebookRM/src/db.h +++ b/protocols/FacebookRM/src/db.h @@ -58,6 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define FACEBOOK_KEY_FILTER_ADS "FilterAds"
#define FACEBOOK_KEY_MESSAGES_ON_OPEN "MessagesOnOpen"
#define FACEBOOK_KEY_MESSAGES_ON_OPEN_COUNT "MessagesOnOpenCount"
+#define FACEBOOK_KEY_HIDE_CHATS "HideChats"
#define FACEBOOK_KEY_POLL_RATE "PollRate" // [HIDDEN]
#define FACEBOOK_KEY_TIMEOUTS_LIMIT "TimeoutsLimit" // [HIDDEN]
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 0c6a91a3bb..326cb85326 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -454,6 +454,7 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L LoadDBCheckState(proto, hwnd, IDC_INBOX_ONLY, FACEBOOK_KEY_INBOX_ONLY, DEFAULT_INBOX_ONLY);
LoadDBCheckState(proto, hwnd, IDC_KEEP_UNREAD, FACEBOOK_KEY_KEEP_UNREAD, DEFAULT_KEEP_UNREAD);
LoadDBCheckState(proto, hwnd, IDC_MESSAGES_ON_OPEN, FACEBOOK_KEY_MESSAGES_ON_OPEN, DEFAULT_MESSAGES_ON_OPEN);
+ LoadDBCheckState(proto, hwnd, IDC_HIDE_CHATS, FACEBOOK_KEY_HIDE_CHATS, DEFAULT_HIDE_CHATS);
int count = proto->getByte(FACEBOOK_KEY_MESSAGES_ON_OPEN_COUNT, 10);
count = min(count, FACEBOOK_MESSAGES_ON_OPEN_LIMIT);
@@ -506,6 +507,7 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L StoreDBCheckState(proto, hwnd, IDC_INBOX_ONLY, FACEBOOK_KEY_INBOX_ONLY);
StoreDBCheckState(proto, hwnd, IDC_KEEP_UNREAD, FACEBOOK_KEY_KEEP_UNREAD);
StoreDBCheckState(proto, hwnd, IDC_MESSAGES_ON_OPEN, FACEBOOK_KEY_MESSAGES_ON_OPEN);
+ StoreDBCheckState(proto, hwnd, IDC_HIDE_CHATS, FACEBOOK_KEY_HIDE_CHATS);
int count = GetDlgItemInt(hwnd, IDC_MESSAGES_COUNT, NULL, TRUE);
count = min(count, FACEBOOK_MESSAGES_ON_OPEN_LIMIT);
diff --git a/protocols/FacebookRM/src/resource.h b/protocols/FacebookRM/src/resource.h index 13646c3dfe..5fb781e678 100644 --- a/protocols/FacebookRM/src/resource.h +++ b/protocols/FacebookRM/src/resource.h @@ -35,6 +35,7 @@ #define IDC_INBOX_ONLY 1038
#define IDC_INBOX_ONLY2 1039
#define IDC_MESSAGES_ON_OPEN 1039
+#define IDC_HIDE_CHATS 1040
#define IDC_NOTIFICATIONS_ENABLE 1041
#define IDC_FEEDS_ENABLE 1042
#define IDC_OTHER_ENABLE 1043
|