extend event compatibility

This commit is contained in:
whale
2020-03-09 00:33:04 +08:00
parent efce1767e6
commit 66a50f0a87
8 changed files with 54 additions and 79 deletions

View File

@@ -42,9 +42,9 @@ class MessageEvent implements SwooleEvent
try {
if (ConnectionManager::get($this->frame->fd)->getType() == "qq") {
$data = json_decode($this->frame->data, true);
if (isset($data["post_type"]))
EventHandler::callCQEvent($data, $this, 0);
else
if (isset($data["post_type"])) {
EventHandler::callCQEvent($data, ConnectionManager::get($this->frame->fd), 0);
} else
EventHandler::callCQResponse($data);
}
foreach (ZMBuf::$events[SwooleEventAt::class] ?? [] as $v) {