Commit 1b5b5ef9 by HanSon Committed by GitHub

Merge pull request #37 from HanSon/dev

支持PHP5
2 parents 45dd2d91 4cdfbefc
......@@ -16,7 +16,6 @@
"pimple/pimple": "^3.0",
"illuminate/support": "^5.3",
"nesbot/carbon": "^1.21",
"php": ">=7.0.0",
"aferrandini/phpqrcode": "^1.0",
"symfony/console": "3.*"
},
......
......@@ -66,7 +66,7 @@ class ContactFactory
}
}
myself()->alias = contact()->get(myself()->username)['Alias'] ?? myself()->nickname ? : myself()->username;
myself()->alias = isset(contact()->get(myself()->username)['Alias']) ? contact()->get(myself()->username)['Alias'] : myself()->nickname ? : myself()->username;
}
/**
......
......@@ -194,9 +194,11 @@ class MessageHandler
{
message()->put($message->msg['MsgId'], $message);
$file = fopen(System::getPath() .'message.json', 'a');
fwrite($file, json_encode($message) . PHP_EOL);
fclose($file);
if(server()->config['debug']) {
$file = fopen(System::getPath() . 'message.json', 'a');
fwrite($file, json_encode($message) . PHP_EOL);
fclose($file);
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!