Commit e76e68ed by HanSon Committed by GitHub

Merge pull request #6 from HanSon/dev

修复撤回历史消息报错
2 parents 02b65c4e 7a35374b
......@@ -49,12 +49,15 @@ class Recall extends Message implements MessageInterface
$msgId = $this->parseMsgId($this->msg['Content']);
/** @var Message $message */
$this->origin = $message = message()->get($msgId);
$this->nickname = $message->sender ? $message->sender['NickName'] : account()->getAccount($message->msg['FromUserName'])['NickName'];
$this->origin = $message = message()->get($msgId, null);
if(!$message){
$this->nickname = $message->sender ? $message->sender['NickName'] : account()->getAccount($message->msg['FromUserName'])['NickName'];
$this->setContent();
}
}
private function setContent()
{
$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!