Commit 4cdfbefc by HanSon

支持PHP5

message文件储存仅debug下写入
1 parent 45dd2d91
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"pimple/pimple": "^3.0", "pimple/pimple": "^3.0",
"illuminate/support": "^5.3", "illuminate/support": "^5.3",
"nesbot/carbon": "^1.21", "nesbot/carbon": "^1.21",
"php": ">=7.0.0",
"aferrandini/phpqrcode": "^1.0", "aferrandini/phpqrcode": "^1.0",
"symfony/console": "3.*" "symfony/console": "3.*"
}, },
......
...@@ -66,7 +66,7 @@ class ContactFactory ...@@ -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 ...@@ -194,9 +194,11 @@ class MessageHandler
{ {
message()->put($message->msg['MsgId'], $message); message()->put($message->msg['MsgId'], $message);
$file = fopen(System::getPath() .'message.json', 'a'); if(server()->config['debug']) {
fwrite($file, json_encode($message) . PHP_EOL); $file = fopen(System::getPath() . 'message.json', 'a');
fclose($file); fwrite($file, json_encode($message) . PHP_EOL);
fclose($file);
}
} }
} }
\ No newline at end of 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!