reywechat 1.0.90__py3-none-any.whl → 1.0.92__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reywechat/rdb.py +27 -27
- {reywechat-1.0.90.dist-info → reywechat-1.0.92.dist-info}/METADATA +1 -1
- {reywechat-1.0.90.dist-info → reywechat-1.0.92.dist-info}/RECORD +5 -5
- {reywechat-1.0.90.dist-info → reywechat-1.0.92.dist-info}/WHEEL +0 -0
- {reywechat-1.0.90.dist-info → reywechat-1.0.92.dist-info}/licenses/LICENSE +0 -0
reywechat/rdb.py
CHANGED
@@ -33,7 +33,7 @@ __all__ = (
|
|
33
33
|
)
|
34
34
|
|
35
35
|
|
36
|
-
class DatabaseORMTableContactUser(rorm.
|
36
|
+
class DatabaseORMTableContactUser(rorm.Table):
|
37
37
|
"""
|
38
38
|
Database `contact_user` table ORM model.
|
39
39
|
"""
|
@@ -44,11 +44,11 @@ class DatabaseORMTableContactUser(rorm.Model, table=True):
|
|
44
44
|
update_time: rorm.Datetime = rorm.Field(field_default=':update_time', index_n=True, comment='Record update time.')
|
45
45
|
user_id: str = rorm.Field(rorm.types.VARCHAR(24), key=True, comment='User ID.')
|
46
46
|
name: str = rorm.Field(rorm.types.VARCHAR(32), comment='User name.')
|
47
|
-
|
48
|
-
|
47
|
+
is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
|
48
|
+
is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
|
49
49
|
|
50
50
|
|
51
|
-
class DatabaseORMTableContactRoom(rorm.
|
51
|
+
class DatabaseORMTableContactRoom(rorm.Table):
|
52
52
|
"""
|
53
53
|
Database `contact_room` table ORM model.
|
54
54
|
"""
|
@@ -59,11 +59,11 @@ class DatabaseORMTableContactRoom(rorm.Model, table=True):
|
|
59
59
|
update_time: rorm.Datetime = rorm.Field(field_default=':update_time', index_n=True, comment='Record update time.')
|
60
60
|
room_id: str = rorm.Field(rorm.types.VARCHAR(31), key=True, comment='Chat room ID.')
|
61
61
|
name: str = rorm.Field(rorm.types.VARCHAR(32), comment='Chat room name.')
|
62
|
-
|
63
|
-
|
62
|
+
is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
|
63
|
+
is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
|
64
64
|
|
65
65
|
|
66
|
-
class DatabaseORMTableContactRoomUser(rorm.
|
66
|
+
class DatabaseORMTableContactRoomUser(rorm.Table):
|
67
67
|
"""
|
68
68
|
Database `contact_room_user` table ORM model.
|
69
69
|
"""
|
@@ -75,11 +75,11 @@ class DatabaseORMTableContactRoomUser(rorm.Model, table=True):
|
|
75
75
|
room_id: str = rorm.Field(rorm.types.VARCHAR(31), key=True, comment='Chat room ID.')
|
76
76
|
user_id: str = rorm.Field(rorm.types.VARCHAR(24), key=True, comment='Chat room user ID.')
|
77
77
|
name: str = rorm.Field(rorm.types.VARCHAR(32), comment='Chat room user name.')
|
78
|
-
|
79
|
-
|
78
|
+
is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
|
79
|
+
is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
|
80
80
|
|
81
81
|
|
82
|
-
class DatabaseORMTableMessageReceive(rorm.
|
82
|
+
class DatabaseORMTableMessageReceive(rorm.Table):
|
83
83
|
"""
|
84
84
|
Database `message_receive` table ORM model.
|
85
85
|
"""
|
@@ -136,7 +136,7 @@ class DatabaseORMTableMessageReceive(rorm.Model, table=True):
|
|
136
136
|
file_id: int = rorm.Field(rorm.types_mysql.MEDIUMINT(unsigned=True), comment='Message file ID, from the file database.')
|
137
137
|
|
138
138
|
|
139
|
-
class DatabaseORMTableMessageSend(rorm.
|
139
|
+
class DatabaseORMTableMessageSend(rorm.Table):
|
140
140
|
"""
|
141
141
|
Database `message_send` table ORM model.
|
142
142
|
"""
|
@@ -499,12 +499,12 @@ class WeChatDatabase(WeChatBase):
|
|
499
499
|
if user_ids == []:
|
500
500
|
sql = (
|
501
501
|
f'UPDATE `{self.db_wechat.database}`.`contact_user`\n'
|
502
|
-
'SET `
|
502
|
+
'SET `is_contact` = 0'
|
503
503
|
)
|
504
504
|
else:
|
505
505
|
sql = (
|
506
506
|
f'UPDATE `{self.db_wechat.database}`.`contact_user`\n'
|
507
|
-
'SET `
|
507
|
+
'SET `is_contact` = 0\n'
|
508
508
|
'WHERE `user_id` NOT IN :user_ids'
|
509
509
|
)
|
510
510
|
conn.execute(
|
@@ -554,12 +554,12 @@ class WeChatDatabase(WeChatBase):
|
|
554
554
|
if room_ids == []:
|
555
555
|
sql = (
|
556
556
|
f'UPDATE `{self.db_wechat.database}`.`contact_room`\n'
|
557
|
-
'SET `
|
557
|
+
'SET `is_contact` = 0'
|
558
558
|
)
|
559
559
|
else:
|
560
560
|
sql = (
|
561
561
|
f'UPDATE `{self.db_wechat.database}`.`contact_room`\n'
|
562
|
-
'SET `
|
562
|
+
'SET `is_contact` = 0\n'
|
563
563
|
'WHERE `room_id` NOT IN :room_ids'
|
564
564
|
)
|
565
565
|
conn.execute(
|
@@ -631,18 +631,18 @@ class WeChatDatabase(WeChatBase):
|
|
631
631
|
if room_user_ids == []:
|
632
632
|
sql = (
|
633
633
|
f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
|
634
|
-
'SET `
|
634
|
+
'SET `is_contact` = 0'
|
635
635
|
)
|
636
636
|
elif room_id is None:
|
637
637
|
sql = (
|
638
638
|
f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
|
639
|
-
'SET `
|
639
|
+
'SET `is_contact` = 0\n'
|
640
640
|
"WHERE CONCAT(`room_id`, ',', `user_id`) NOT IN :room_user_ids"
|
641
641
|
)
|
642
642
|
else:
|
643
643
|
sql = (
|
644
644
|
f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
|
645
|
-
'SET `
|
645
|
+
'SET `is_contact` = 0\n'
|
646
646
|
'WHERE (\n'
|
647
647
|
' `room_id` = :room_id\n'
|
648
648
|
" AND CONCAT(`room_id`, ',', `user_id`) NOT IN :room_user_ids\n"
|
@@ -765,7 +765,7 @@ class WeChatDatabase(WeChatBase):
|
|
765
765
|
## Generate data.
|
766
766
|
data = {
|
767
767
|
'room_id': message.room,
|
768
|
-
'
|
768
|
+
'is_contact': 0,
|
769
769
|
'limit': 1
|
770
770
|
}
|
771
771
|
|
@@ -1036,7 +1036,7 @@ class WeChatDatabase(WeChatBase):
|
|
1036
1036
|
if message.room is None:
|
1037
1037
|
result = message.receiver.wechat.db.db_wechat.execute.select(
|
1038
1038
|
'message_send',
|
1039
|
-
['
|
1039
|
+
['is_valid'],
|
1040
1040
|
'`user_id` = :user_id',
|
1041
1041
|
limit=1,
|
1042
1042
|
user_id=message.user
|
@@ -1046,7 +1046,7 @@ class WeChatDatabase(WeChatBase):
|
|
1046
1046
|
elif message.user is None:
|
1047
1047
|
result = message.receiver.wechat.db.db_wechat.execute.select(
|
1048
1048
|
'message_send',
|
1049
|
-
['
|
1049
|
+
['is_valid'],
|
1050
1050
|
'`room_id` = :room_id',
|
1051
1051
|
limit=1,
|
1052
1052
|
room_id=message.room
|
@@ -1056,18 +1056,18 @@ class WeChatDatabase(WeChatBase):
|
|
1056
1056
|
else:
|
1057
1057
|
sql = (
|
1058
1058
|
'SELECT (\n'
|
1059
|
-
' SELECT `
|
1059
|
+
' SELECT `is_valid`\n'
|
1060
1060
|
f' FROM `{self.db_wechat.database}`.`contact_room_user`\n'
|
1061
1061
|
' WHERE `room_id` = :room_id AND `user_id` = :user_id\n'
|
1062
1062
|
' LIMIT 1\n'
|
1063
|
-
') AS `
|
1063
|
+
') AS `is_valid`\n'
|
1064
1064
|
'FROM (\n'
|
1065
|
-
' SELECT `
|
1065
|
+
' SELECT `is_valid`\n'
|
1066
1066
|
f' FROM `{self.db_wechat.database}`.`contact_room`\n'
|
1067
1067
|
' WHERE `room_id` = :room_id\n'
|
1068
1068
|
' LIMIT 1\n'
|
1069
1069
|
') AS `a`\n'
|
1070
|
-
'WHERE `
|
1070
|
+
'WHERE `is_valid` = 1'
|
1071
1071
|
)
|
1072
1072
|
result = message.receiver.wechat.db.db_wechat.execute(
|
1073
1073
|
sql,
|
@@ -1075,8 +1075,8 @@ class WeChatDatabase(WeChatBase):
|
|
1075
1075
|
user_id=message.user
|
1076
1076
|
)
|
1077
1077
|
|
1078
|
-
|
1079
|
-
judge =
|
1078
|
+
is_valid = result.scalar()
|
1079
|
+
judge = is_valid == 1
|
1080
1080
|
|
1081
1081
|
return judge
|
1082
1082
|
|
@@ -3,14 +3,14 @@ reywechat/rall.py,sha256=ReNbm_oZTrD8lW_deMEgUfAE8yRm4NjbBWmvZuPjEg8,362
|
|
3
3
|
reywechat/rbase.py,sha256=BpjxxPhvUBTf7V7Q2qYU4rHzQh9OlZCbFtdav6rDaT8,1115
|
4
4
|
reywechat/rcache.py,sha256=HxVOvXVsO1JjVGYBvF4YHSJGlcfgMcSYvT5JCmEuumM,899
|
5
5
|
reywechat/rclient.py,sha256=9Xzy_XUu-b2kRzM7MpwefZ6pZsrn5EnrLv5fs7Yh2Ew,22570
|
6
|
-
reywechat/rdb.py,sha256=
|
6
|
+
reywechat/rdb.py,sha256=R9kPcsooC7zmfNW6OIE0Oh3ssS5q_VmFtzNpCTS69xs,37777
|
7
7
|
reywechat/rlog.py,sha256=IDtCmllHN6Wz33qeNZLXaK0s-s5dWIqIeQXc5u7lsnk,5235
|
8
8
|
reywechat/rreceive.py,sha256=uUaJd3U8lu_wh3bSBoKo09pumbYnBszgsCKb5SbwrOI,50823
|
9
9
|
reywechat/rsend.py,sha256=GwoM1iYFSXvsZ-q6etQhnYYW0W54os97kFJhWNnlpLs,19892
|
10
10
|
reywechat/rtrigger.py,sha256=m1hfOA8rya4qk2Z02Ic9uvMO5ylwSaBJRYkcCLk60y0,4935
|
11
11
|
reywechat/rwechat.py,sha256=wyYARNSCFE_VyB9WI1Hqq144gPl_FOFztx7krsRT4MY,4716
|
12
12
|
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
13
|
-
reywechat-1.0.
|
14
|
-
reywechat-1.0.
|
15
|
-
reywechat-1.0.
|
16
|
-
reywechat-1.0.
|
13
|
+
reywechat-1.0.92.dist-info/METADATA,sha256=OsrRHEVJteVlVmnz9HTxZ6KDbp4krYZ7pxqk_SUKue0,1596
|
14
|
+
reywechat-1.0.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
reywechat-1.0.92.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
+
reywechat-1.0.92.dist-info/RECORD,,
|
File without changes
|
File without changes
|