From c2e4d88842198c74f07c2809b6584cde91474bb8 Mon Sep 17 00:00:00 2001 From: Bachery Date: Wed, 8 Mar 2023 17:27:32 +0100 Subject: [PATCH] fix compatibility --- channel/wechat/wechat_channel.py | 7 ++++--- channel/wechat/wechaty_channel.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index e930fe9..fcaa465 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -149,9 +149,10 @@ class WechatChannel(Channel): context = dict() group_name = msg['User']['NickName'] group_id = msg['User']['UserName'] - if ('ALL_GROUP' in conf().get('group_chat_in_one_session') or \ - group_name in conf().get('group_chat_in_one_session')) or \ - self.check_contain(group_name, conf().get('group_chat_in_one_session')): + group_chat_in_one_session = conf().get('group_chat_in_one_session', []) + if ('ALL_GROUP' in group_chat_in_one_session or \ + group_name in group_chat_in_one_session or \ + self.check_contain(group_name, group_chat_in_one_session)): context['session_id'] = group_id else: context['session_id'] = msg['ActualUserName'] diff --git a/channel/wechat/wechaty_channel.py b/channel/wechat/wechaty_channel.py index 331bc57..5e01464 100644 --- a/channel/wechat/wechaty_channel.py +++ b/channel/wechat/wechaty_channel.py @@ -163,9 +163,10 @@ class WechatyChannel(Channel): if not query: return context = dict() - if ('ALL_GROUP' in conf().get('group_chat_in_one_session') or \ - group_name in conf().get('group_chat_in_one_session') or \ - self.check_contain(group_name, conf().get('group_chat_in_one_session'))): + group_chat_in_one_session = conf().get('group_chat_in_one_session', []) + if ('ALL_GROUP' in group_chat_in_one_session or \ + group_name in group_chat_in_one_session or \ + self.check_contain(group_name, group_chat_in_one_session)): context['session_id'] = str(group_id) else: context['session_id'] = str(group_id) + '-' + str(group_user_id)