Skip to content

Commit

Permalink
群聊增加群成员显示
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Sep 6, 2024
1 parent bc53238 commit 4decd8c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions pywxdump/db/dbMicro.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def get_room_list(self, word=None, roomwxids: list = None):
DisplayNameList = DisplayNameList.split("^G")

RoomData = ChatRoom_RoomData(RoomData)
wxid2remark = {}
wxid2roomNickname = {}
if RoomData:
rd = []
for k, v in RoomData.items():
Expand All @@ -276,13 +276,20 @@ def get_room_list(self, word=None, roomwxids: list = None):
for i in rd:
try:
if isinstance(i, dict) and isinstance(i.get('1'), str) and i.get('2'):
wxid2remark[i['1']] = i["2"]
wxid2roomNickname[i['1']] = i["2"]
except Exception as e:
db_loger.error(f"wxid2remark: ChatRoomName:{ChatRoomName}, {i} error:{e}", exc_info=True)

wxid2userinfo = self.get_user_list(wxids=UserNameList)
for i in wxid2userinfo:
wxid2userinfo[i]["roomNickname"] = wxid2roomNickname.get(i, "")

owner = wxid2userinfo.get(Reserved2, Reserved2)

rooms[ChatRoomName] = {
"wxid": ChatRoomName, "UserNameList": UserNameList, "DisplayNameList": DisplayNameList,
"ChatRoomFlag": ChatRoomFlag, "IsShowName": IsShowName, "SelfDisplayName": SelfDisplayName,
"owner": Reserved2, "wxid2remark": wxid2remark,
"wxid": ChatRoomName, "roomWxids": UserNameList, "IsShowName": IsShowName,
"ChatRoomFlag": ChatRoomFlag, "SelfDisplayName": SelfDisplayName,
"owner": owner, "wxid2userinfo": wxid2userinfo,
"Announcement": Announcement, "AnnouncementEditor": AnnouncementEditor,
"AnnouncementPublishTime": AnnouncementPublishTime}
return rooms
Expand Down

0 comments on commit 4decd8c

Please sign in to comment.