summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-07-09 08:30:07 +0000
committerRobert Pösel <robyer@seznam.cz>2014-07-09 08:30:07 +0000
commit047076a15f1588d173e09dbb33f9beb15756f408 (patch)
tree7a184818363ad4d2c99462ccae4e2d71ac57954a
parentb6f230e41a7c206b609336e401e399a332748263 (diff)
Core: Add PF4_GROUPCHATFILES flag to mark protocols that support sending files to group chats
StdFile: Don't show "Send file" menu item for groupchats of protocols that doesn't support it git-svn-id: http://svn.miranda-ng.org/main/trunk@9740 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/delphi/m_protosvc.inc1
-rw-r--r--include/m_protosvc.h1
-rw-r--r--src/core/stdfile/file.cpp3
3 files changed, 4 insertions, 1 deletions
diff --git a/include/delphi/m_protosvc.inc b/include/delphi/m_protosvc.inc
index 36c20984d9..fff2e30ad6 100644
--- a/include/delphi/m_protosvc.inc
+++ b/include/delphi/m_protosvc.inc
@@ -128,6 +128,7 @@ const
PF4_IMSENDOFFLINE = $00000100; // protocol supports sending offline messages (v0.8.0+)
PF4_INFOSETTINGSVC = $00000200; // protocol supports user info translation services (v0.8.0+)
PF4_NOAUTHDENYREASON = $00000400; // protocol doesn't support authorization deny reason (v0.9.0+)
+ PF4_GROUPCHATFILES = $00000800; // protocol supports sending files to group chats (v0.95.2+)
PFLAG_UNIQUEIDTEXT = 100; // returns a static buffer of text describing the unique field by which this protocol identifies users (already translated), or NULL
PFLAG_MAXCONTACTSPERPACKET = 200; // v0.1.2.2+: returns the maximum number of contacts which can be sent in a single PSS_CONTACTS. lParam=(LPARAM)hContact.
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index 1a5dd3d817..fa5c3cb3ad 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -143,6 +143,7 @@ static __inline unsigned long Proto_Status2Flag(int status)
#define PF4_IMSENDOFFLINE 0x00000100 // protocol supports sending offline messages (v0.8.0+)
#define PF4_INFOSETTINGSVC 0x00000200 // protocol supports user info translation services (v0.8.0+)
#define PF4_NOAUTHDENYREASON 0x00000400 // protocol doesn't support authorization deny reason (v0.9.0+)
+#define PF4_GROUPCHATFILES 0x00000800 // protocol supports sending files to group chats (v0.95.2+)
#define PFLAG_UNIQUEIDTEXT 100 //returns a static buffer of text describing the unique field by which this protocol identifies users (already translated), or NULL
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp
index 97b7d9549d..413a202751 100644
--- a/src/core/stdfile/file.cpp
+++ b/src/core/stdfile/file.cpp
@@ -308,7 +308,8 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM)
bool bEnabled = false;
char *szProto = GetContactProto(wParam);
if (szProto != NULL) {
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_FILESEND) {
+ bool isChat = db_get_b(wParam, szProto, "ChatRoom", false) != 0;
+ if (CallProtoService(szProto, PS_GETCAPS, isChat ? PFLAGNUM_4 : PFLAGNUM_1, 0) & (isChat ? PF4_GROUPCHATFILES : PF1_FILESEND)) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES)
bEnabled = true;
else if (db_get_w(wParam, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)