Bläddra i källkod

添加群历史消息设置

heavyrain.lee 4 år sedan
förälder
incheckning
e0161a21ac

+ 4 - 0
wfclient/WFChatClient/Client/WFCCIMService.mm

@@ -1035,6 +1035,8 @@ WFCCGroupInfo *convertProtoGroupInfo(mars::stn::TGroupInfo tgi) {
     groupInfo.joinType = tgi.joinType;
     groupInfo.privateChat = tgi.privateChat;
     groupInfo.searchable = tgi.searchable;
+    groupInfo.historyMessage = tgi.historyMessage;
+    groupInfo.maxMemberCount = tgi.maxMemberCount;
     return groupInfo;
 }
 
@@ -1537,6 +1539,7 @@ WFCCGroupInfo *convertProtoGroupInfo(mars::stn::TGroupInfo tgi) {
         member.memberId = [NSString stringWithUTF8String:it->memberId.c_str()];
         member.alias = [NSString stringWithUTF8String:it->alias.c_str()];
         member.type = (WFCCGroupMemberType)it->type;
+        member.createTime = it->createDt;
         [output addObject:member];
     }
     return output;
@@ -1554,6 +1557,7 @@ WFCCGroupInfo *convertProtoGroupInfo(mars::stn::TGroupInfo tgi) {
         member.memberId = memberId;
         member.alias = [NSString stringWithUTF8String:tmember.alias.c_str()];
         member.type = (WFCCGroupMemberType)tmember.type;
+        member.createTime = tmember.createDt;
         return member;
     }
     return nil;

+ 10 - 0
wfclient/WFChatClient/Model/WFCCGroupInfo.h

@@ -80,4 +80,14 @@ typedef NS_ENUM(NSInteger, WFCCGroupType) {
  群搜索状态,0 群可以被搜索到;1 群不会被搜索到
  */
 @property (nonatomic, assign)int searchable;
+
+/**
+ 群成员是否可以加载加入之前的历史消息,0不可以;1可以
+ */
+@property (nonatomic, assign)int historyMessage;
+
+/**
+ 群的最大成员数,可以通过server api来修改
+ */
+@property (nonatomic, assign)int maxMemberCount;
 @end

+ 5 - 0
wfclient/WFChatClient/Model/WFCCGroupMember.h

@@ -48,4 +48,9 @@ typedef NS_ENUM(NSInteger, WFCCGroupMemberType) {
  */
 @property(nonatomic, assign)WFCCGroupMemberType type;
 
+/**
+ 群成员加入时间戳
+*/
+@property(nonatomic, assign)long long createTime;
+
 @end

+ 2 - 2
wfclient/WFChatClient/Proto/mars.framework/Headers/comm/verinfo.h

@@ -2,10 +2,10 @@
 #ifndef Mars_verinfo_h
 #define Mars_verinfo_h
 
-#define MARS_REVISION "d8f88059"
+#define MARS_REVISION "3eec1194"
 #define MARS_PATH "firechat"
 #define MARS_URL ""
-#define MARS_BUILD_TIME "2020-06-23 22:25:52"
+#define MARS_BUILD_TIME "2020-06-25 16:26:55"
 #define MARS_TAG ""
 
 #endif

+ 3 - 1
wfclient/WFChatClient/Proto/mars.framework/Headers/proto/proto.h

@@ -138,7 +138,7 @@ namespace mars{
 
         class TGroupInfo : public TSerializable {
         public:
-            TGroupInfo() : target(""), type(0), memberCount(0), updateDt(0), mute(0), joinType(0), privateChat(0), searchable(0) {}
+            TGroupInfo() : target(""), type(0), memberCount(0), updateDt(0), mute(0), joinType(0), privateChat(0), searchable(0), historyMessage(0), maxMemberCount(0) {}
             std::string target;
             std::string name;
             std::string portrait;
@@ -151,6 +151,8 @@ namespace mars{
             int joinType;
             int privateChat;
             int searchable;
+            int historyMessage;
+            int maxMemberCount;
             virtual ~TGroupInfo() {}
 #if WFCHAT_PROTO_SERIALIZABLE
             virtual void Serialize(void *writer) const;

BIN
wfclient/WFChatClient/Proto/mars.framework/mars


+ 47 - 3
wfuikit/WFChatUIKit/ConversationSetting/ViewController/GroupManageTableViewController.m

@@ -86,6 +86,17 @@
         } else if(indexPath.row == 1) {
             cell.textLabel.text = WFCString(@"GroupVisiable");
             cell.detailTextLabel.text = WFCString(@"GroupCannotSearch");
+        } else if(indexPath.row == 2) {
+            cell.textLabel.text = WFCString(@"GroupHistoryMessage");
+            if (self.groupInfo.historyMessage > 0) {
+                cell.detailTextLabel.text = WFCString(@"GroupHistoryMessageAviable");
+            } else {
+                cell.detailTextLabel.text = WFCString(@"GroupHistoryMessageNotAviable");
+            }
+            
+        } else if(indexPath.row == 3) {
+            cell.textLabel.text = WFCString(@"GroupMaxMember");
+            cell.detailTextLabel.text = [NSString stringWithFormat:@"%d", self.groupInfo.maxMemberCount];
         }
     }
     
@@ -99,7 +110,11 @@
         }
         return 2;//设置禁言,群成员权限
     } else if(section == 1) {
-        return 2;//加群方式,查找权限
+        if ([[WFCCIMService sharedWFCIMService] isCommercialServer]) {
+            return 4;//加群方式,查找权限,历史消息,最大成员数
+        } else {
+            return 2;//加群方式,查找权限
+        }
     }
     return 0;
 }
@@ -108,7 +123,7 @@
     if (section == 0) {
         return WFCString(@"MemberManage");
     } else if(section == 1) {
-        return WFCString(@"JoinGroupSetting");
+        return WFCString(@"GroupGeneralSetting");
     }
     return nil;
 }
@@ -214,7 +229,36 @@
             [alertController addAction:verifyAction];
             
             [self.navigationController presentViewController:alertController animated:YES completion:nil];
-        }
+        } else if(indexPath.row == 2) {
+                UIAlertController* alertController = [UIAlertController alertControllerWithTitle:WFCString(@"GroupHistoryMessage") message:nil preferredStyle:UIAlertControllerStyleActionSheet];
+                
+                // Create cancel action.
+                UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:WFCString(@"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                    
+                }];
+                [alertController addAction:cancelAction];
+                
+            UIAlertAction *openAction = [UIAlertAction actionWithTitle:WFCString(@"GroupHistoryMessageAviable") style:self.groupInfo.historyMessage > 0 ? UIAlertActionStyleDestructive : UIAlertActionStyleDefault  handler:^(UIAlertAction *action) {
+                    [[WFCCIMService sharedWFCIMService] modifyGroupInfo:self.groupInfo.target type:Modify_Group_History_Message newValue:@"1" notifyLines:@[@(0)] notifyContent:nil success:^{
+                        self.groupInfo.historyMessage = 1;
+                                    } error:^(int error_code) {
+                                        [self.view makeToast:@"设置失败"];
+                                    }];
+                }];
+                [alertController addAction:openAction];
+                
+            UIAlertAction *verifyAction = [UIAlertAction actionWithTitle:WFCString(@"GroupHistoryMessageNotAviable") style:self.groupInfo.historyMessage > 0 ? UIAlertActionStyleDefault : UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+                    [[WFCCIMService sharedWFCIMService] modifyGroupInfo:self.groupInfo.target type:Modify_Group_History_Message newValue:@"0" notifyLines:@[@(0)] notifyContent:nil success:^{
+                        self.groupInfo.historyMessage = 0;
+                    } error:^(int error_code) {
+                        [self.view makeToast:@"设置失败"];
+                    }];
+                }];
+                [alertController addAction:verifyAction];
+                
+                [self.navigationController presentViewController:alertController animated:YES completion:nil];
+            }
+        
     }
     
 }

+ 5 - 1
wfuikit/WFChatUIKit/Resources/en.lproj/wfc.strings

@@ -119,9 +119,13 @@
 "ManagerInviteOnly"="Only manager invite";
 "GroupVisiable"="Group visiablity";
 "GroupCanbeSearch"="Group can be searched";
+"GroupHistoryMessageAviable"="Group history message aviable";
+"GroupHistoryMessageNotAviable"="Group history message not aviable";
 "GroupCannotSearch"="Group can not be searched";
 "MemberManage"="Member manage";
-"JoinGroupSetting"="Join group setting";
+"GroupGeneralSetting"="Group general setting";
+"GroupMaxMember"="Group max member count";
+"GroupHistoryMessage"="Group history message";
 "ManagerSetting"="Manager setting";
 "AddManager"="Add manager";
 "RemoveManager"="Remove manager";

+ 5 - 1
wfuikit/WFChatUIKit/Resources/zh-Hans.lproj/wfc.strings

@@ -118,10 +118,14 @@
 "MemberInviteOnly"="群成员可以拉人";
 "ManagerInviteOnly"="只能群管理拉人";
 "GroupVisiable"="群的可见性";
+"GroupHistoryMessageAviable"="群历史消息可见";
+"GroupHistoryMessageNotAviable"="群历史消息不可见";
 "GroupCanbeSearch"="群可以被查找";
 "GroupCannotSearch"="群不可以被查找";
 "MemberManage"="成员管理";
-"JoinGroupSetting"="加群设置";
+"GroupGeneralSetting"="群通用设置";
+"GroupHistoryMessage"="群历史消息";
+"GroupMaxMember"="群最大成员数";
 "ManagerSetting"="管理员设置";
 "AddManager"="添加管理员";
 "RemoveManager"="移除管理员";