feat: add channel tag to subscription response in RPCView.list_channels

Include the channel's tag field when building the subscription list response, fetching the full channel object to populate the new "tag" key alongside existing name, uid, and permission fields.
This commit is contained in:
2025-02-15 22:01:43 +00:00
parent 7c65768e8e
commit b38978a7ea
+2
View File
@@ -83,9 +83,11 @@ class RPCView(BaseView):
self._require_login()
channels = []
async for subscription in self.services.channel_member.find(user_uid=self.user_uid, is_banned=False):
channel = await self.services.channel.get(uid=subscription['uid'])
channels.append({
"name": subscription["label"],
"uid": subscription["channel_uid"],
"tag": channel["tag"],
"is_moderator": subscription["is_moderator"],
"is_read_only": subscription["is_read_only"]
})