Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Messages.forward() now supports personal cards sent from self
Browse files Browse the repository at this point in the history
  • Loading branch information
youfou committed Apr 15, 2017
1 parent 8ce6126 commit f0acc25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions wxpy/api/messages/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def forward(self, chat, prefix=None, suffix=None, raise_for_unsupported=False):
* 名片 (`CARD`)
* 仅支持公众号名片
* 仅支持公众号名片,以及自己发出的个人号名片
* 分享 (`SHARING`)
Expand Down Expand Up @@ -344,9 +344,9 @@ def raise_properly(text):
)

elif self.type is CARD:
if self.card.raw.get('AttrStatus'):
# 为个人名片
raise_properly('Personal cards are unsupported:\n{}'.format(self))
if self.card.raw.get('AttrStatus') and self.sender != self.bot.self:
# 为个人名片,且不为自己所发出
raise_properly('Personal cards sent from others are unsupported:\n{}'.format(self))
else:
return wrapped_send(
send_type='raw_msg',
Expand Down
4 changes: 2 additions & 2 deletions wxpy/ext/sync_message_in_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def sync_message_in_groups(
* 名片 (`CARD`)
* 仅支持公众号名片
* 仅支持公众号名片,以及自己发出的个人号名片
* 分享 (`SHARING`)
Expand All @@ -59,7 +59,7 @@ def sync_message_in_groups(
* 语音 (`RECORDING`)
* 会以文件方式发送
* 地图 (`MAP`)
* 会转化为 `位置名称 + 地图链接` 形式的文本消息
Expand Down

0 comments on commit f0acc25

Please sign in to comment.