Commit 7a35374b by HanSon

修复撤回历史消息报错

1 parent 6cab8c20
...@@ -49,12 +49,15 @@ class Recall extends Message implements MessageInterface ...@@ -49,12 +49,15 @@ class Recall extends Message implements MessageInterface
$msgId = $this->parseMsgId($this->msg['Content']); $msgId = $this->parseMsgId($this->msg['Content']);
/** @var Message $message */ /** @var Message $message */
$this->origin = $message = message()->get($msgId); $this->origin = $message = message()->get($msgId, null);
$this->nickname = $message->sender ? $message->sender['NickName'] : account()->getAccount($message->msg['FromUserName'])['NickName'];
if(!$message){
$this->nickname = $message->sender ? $message->sender['NickName'] : account()->getAccount($message->msg['FromUserName'])['NickName'];
$this->setContent(); $this->setContent();
} }
}
private function setContent() private function setContent()
{ {
$this->content = "{$this->nickname} 刚撤回了消息"; $this->content = "{$this->nickname} 刚撤回了消息";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!