Skip to content

Commit f0257a9

Browse files
committed
update for signal default info
1 parent 511c3fe commit f0257a9

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

client/handle.py

+22-17
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ def handle_response(ws_t, j: json):
1919
RECV_SERVER_HINT: print,
2020
RECV_TXT_MSG: handle_recv_txt_msg,
2121
RECV_PIC_MSG: handle_recv_pic_msg,
22-
RECV_GZH_MSG: print,
22+
# RECV_GZH_MSG: print,
2323
RECV_SNS_MSG: print,
2424
RECV_HISTORY_MSG: print,
2525
RECV_APP_MSG: print,
2626
RECV_FRIEND_REQUEST: print,
27-
RECV_STICKER_MSG: print,
27+
# RECV_STICKER_MSG: print,
2828
RECV_XML_MSG: handle_recv_xml_txt,
29-
RECV_DVC_MSG: print,
29+
# RECV_DVC_MSG: print,
3030
RECV_VIDEO_MSG: print,
3131
RECV_MUSIC_MSG: print,
3232
RECV_CITE_MSG: print,
3333
RECV_APPAUDIO_MSG: print,
3434
RECV_HOOK_SNS: print,
3535
RECV_OTHER_MSG: print,
36-
OP_READ_MSG_WHILE_OPEN_DVC: print,
37-
OP_OPEN_CHAT_DVC: print,
38-
OP_REFRESH_LIST_DVC: print,
39-
OP_SNS_CHECK_UNREAD_DVC: print,
40-
OP_SNS_SELF_ACTION_DVC: print,
41-
OP_REFRESH_MSG_DVC: print,
42-
OP_DELETE_CHATROOM_MSG_DVC: print,
36+
# OP_READ_MSG_WHILE_OPEN_DVC: print,
37+
# OP_OPEN_CHAT_DVC: print,
38+
# OP_REFRESH_LIST_DVC: print,
39+
# OP_SNS_CHECK_UNREAD_DVC: print,
40+
# OP_SNS_SELF_ACTION_DVC: print,
41+
# OP_REFRESH_MSG_DVC: print,
42+
# OP_DELETE_CHATROOM_MSG_DVC: print,
4343
ADD_MEMBER_CHATROOM: print,
4444
DEL_MEMBER_CHATROOM: print,
4545
INVITE_MEMBER_CHATROOM: print,
@@ -77,8 +77,9 @@ def handle_response(ws_t, j: json):
7777
ENABLE_WECHAT_LOG: print,
7878
DISABLE_WECHAT_LOG: print
7979
}
80-
81-
action.get(resp_type, print)(j)
80+
func = action.get(resp_type)
81+
if func is not None:
82+
func(j)
8283

8384

8485
def handle_nick(j):
@@ -114,8 +115,6 @@ def handle_wxuser_list(j):
114115

115116

116117
def handle_recv_txt_msg(j):
117-
print(j)
118-
119118
if j['fromUser'] == my_info.wx_id:
120119
wx_id = j['toUser']
121120
else:
@@ -139,6 +138,11 @@ def handle_recv_txt_msg(j):
139138
else:
140139
wx_id = my_info.wx_id
141140

141+
print(content +
142+
' From: ' + j['fromUser'] +
143+
' To: ' + j['toUser'] +
144+
' \'type\': ' + str(j['type']))
145+
142146
chatbot = global_dict.get((wx_id, room_id))
143147

144148
is_citation = (grpCitationMode and is_room) or (prvCitationMode and not is_room)
@@ -245,8 +249,9 @@ def handle_recv_xml_txt(j):
245249

246250
def handle_self_info(j):
247251
print(j)
248-
data = j["data"]
252+
data = j['data']
249253

250254
global my_info
251-
my_info = Selfinfo(data["wxid"], data["name"], data["account"], data["currentDataPath"], data["dataSavePath"],
252-
data["dbKey"])
255+
my_info = Selfinfo(data['wxid'], data['name'], data['account'],
256+
data['currentDataPath'], data['dataSavePath'],
257+
data['dbKey'])

0 commit comments

Comments
 (0)