summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r--protocols/FacebookRM/src/proto.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index e5e5f9c47c..708f692c64 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -36,6 +36,7 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) :
facy.fcb_conn_lock_ = CreateMutex(NULL, FALSE, NULL);
m_invisible = false;
+ m_disableChat = getBool(FACEBOOK_KEY_DISABLE_CHAT, false);
CreateProtoService(PS_CREATEACCMGRUI, &FacebookProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETMYAWAYMSG, &FacebookProto::GetMyAwayMsg);
@@ -44,8 +45,10 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) :
CreateProtoService(PS_GETAVATARCAPS, &FacebookProto::GetAvatarCaps);
CreateProtoService(PS_GETUNREADEMAILCOUNT, &FacebookProto::GetNotificationsCount);
- CreateProtoService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
- CreateProtoService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
+ if (!m_disableChat) {
+ CreateProtoService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
+ CreateProtoService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
+ }
CreateProtoService("/Mind", &FacebookProto::OnMind);
CreateProtoService("/VisitProfile", &FacebookProto::VisitProfile);
@@ -116,7 +119,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT hContact)
{
case PFLAGNUM_1:
{
- DWORD_PTR flags = PF1_IM | PF1_CHAT | PF1_SERVERCLIST | PF1_AUTHREQ | /*PF1_ADDED |*/ PF1_BASICSEARCH | PF1_SEARCHBYEMAIL | PF1_SEARCHBYNAME | PF1_ADDSEARCHRES; // | PF1_VISLIST | PF1_INVISLIST;
+ DWORD_PTR flags = PF1_IM | (!m_disableChat ? PF1_CHAT : 0) | PF1_SERVERCLIST | PF1_AUTHREQ | /*PF1_ADDED |*/ PF1_BASICSEARCH | PF1_SEARCHBYEMAIL | PF1_SEARCHBYNAME | PF1_ADDSEARCHRES; // | PF1_VISLIST | PF1_INVISLIST;
if (getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, 0))
return flags |= PF1_MODEMSG;
@@ -416,14 +419,16 @@ INT_PTR FacebookProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
int FacebookProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
// Register group chat
- GCREGISTER gcr = {sizeof(gcr)};
- gcr.dwFlags = 0; //GC_ACKMSG;
- gcr.pszModule = m_szModuleName;
- gcr.ptszDispName = m_tszUserName;
- gcr.iMaxText = FACEBOOK_MESSAGE_LIMIT;
- gcr.nColors = 0;
- gcr.pColors = NULL;
- CallService(MS_GC_REGISTER,0,reinterpret_cast<LPARAM>(&gcr));
+ if (!m_disableChat) {
+ GCREGISTER gcr = { sizeof(gcr) };
+ gcr.dwFlags = 0; //GC_ACKMSG;
+ gcr.pszModule = m_szModuleName;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.iMaxText = FACEBOOK_MESSAGE_LIMIT;
+ gcr.nColors = 0;
+ gcr.pColors = NULL;
+ CallService(MS_GC_REGISTER, 0, reinterpret_cast<LPARAM>(&gcr));
+ }
return 0;
}