浏览代码

Hide rooms when adding to personal filtering community

Tulir Asokan 5 年之前
父节点
当前提交
a7601fa4cc
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      community.go

+ 5 - 1
community.go

@@ -89,7 +89,11 @@ func (user *User) addPortalToCommunity(portal *Portal) bool {
 	}
 	bot := user.bridge.Bot
 	url := bot.BuildURL("groups", user.CommunityID, "admin", "rooms", portal.MXID)
-	reqBody := map[string]interface{}{}
+	reqBody := map[string]map[string]string{
+		"m.visibility": {
+			"type": "private",
+		},
+	}
 	_, err := bot.MakeRequest(http.MethodPut, url, &reqBody, nil)
 	if err != nil {
 		user.log.Warnfln("Failed to add %s to %s: %v", portal.MXID, user.CommunityID, err)