From 1d6faa5796c225d555b51ca3d9e70ef78ac20930 Mon Sep 17 00:00:00 2001 From: heavyrian2012 Date: Thu, 29 May 2025 14:18:29 +0800 Subject: [PATCH] =?UTF-8?q?server=20api=E6=94=AF=E6=8C=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BE=A4=E7=BB=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/moquette/persistence/MemoryMessagesStore.java | 8 ++++++++ .../main/java/cn/wildfirechat/proto/ProtoConstants.java | 1 + 2 files changed, 9 insertions(+) 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