diff --git a/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java b/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java index 857928f8..b5468025 100755 --- a/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java +++ b/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java @@ -1963,6 +1963,14 @@ public class MemoryMessagesStore implements IMessagesStore { newInfoBuilder.setPrivateChat(Integer.parseInt(value)); else if(modifyType == Modify_Group_Searchable) newInfoBuilder.setSearchable(Integer.parseInt(value)); + else if(modifyType == Modify_Group_Type) { + int newType = Integer.parseInt(value); + if(newType < 0 || newType > ProtoConstants.GroupType.GroupType_Organization) { + LOG.error("modify group type failure, invalid group type {}", newType); + return ErrorCode.INVALID_PARAMETER; + } + newInfoBuilder.setType(newType); + } else return ErrorCode.INVALID_PARAMETER; diff --git a/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java b/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java index 1dde35dd..2fff6520 100644 --- a/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java +++ b/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java @@ -172,6 +172,7 @@ public class ProtoConstants { int Modify_Group_Max_Member_Count = 8; //仅专业版的server api支持 int Modify_Group_Super_Group = 9; + int Modify_Group_Type = 10; } //ModifyGroupInfoRequest -> type