Commit 94892c7c by HanSon

修改PHP5兼容

1 parent 17f576d3
......@@ -33,6 +33,8 @@ class ContactFactory
$this->makeContactList();
myself()->alias = contact()->get(myself()->username)['Alias'] ?? myself()->nickname ? : myself()->username;
$this->getBatchGroupMembers();
if(server()->config['debug']){
......@@ -65,8 +67,6 @@ class ContactFactory
contact()->put($contact['UserName'], $contact);
}
}
myself()->alias = contact()->get(myself()->username)['Alias'] ?? myself()->nickname ? : myself()->username;
}
/**
......
......@@ -27,16 +27,18 @@ class Text extends Message implements MessageInterface
/**
* 发送消息
*
* @param $word string 消息内容
* @param $word string|Text 消息内容
* @param $username string 目标username
* @return bool
*/
public static function send($username, string $word)
public static function send($username, $word)
{
if (!$word) {
return false;
}
$word = is_string($word) ? $word : $word->content;
$random = strval(time() * 1000) . '0' . strval(rand(100, 999));
$data = [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!