hyperf-chat/app/Constants/TalkMessageType.php

39 lines
1014 B
PHP
Raw Normal View History

2021-07-01 23:10:18 +08:00
<?php
2021-08-14 17:31:21 +08:00
declare(strict_types=1);
2021-07-01 23:10:18 +08:00
namespace App\Constants;
/**
* Class TalkMessageType
*
* @package App\Constants
*/
2021-07-08 19:30:03 +08:00
class TalkMessageType
2021-07-01 23:10:18 +08:00
{
2021-10-31 21:32:50 +08:00
const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息
const TEXT_MESSAGE = 1; //文本消息
const FILE_MESSAGE = 2; //文件消息
const FORWARD_MESSAGE = 3; //会话消息
const CODE_MESSAGE = 4; //代码消息
const VOTE_MESSAGE = 5; //投票消息
const GROUP_NOTICE_MESSAGE = 6; //群组公告
const FRIEND_APPLY_MESSAGE = 7; //好友申请
const USER_LOGIN_MESSAGE = 8; //登录通知
const GROUP_INVITE_MESSAGE = 9; //入群退群消息
const LOCATION_MESSAGE = 10; //位置消息(预留)
2021-08-14 17:31:21 +08:00
/**
* 获取可转发的消息类型列表
*
* @return array
*/
public static function getForwardTypes(): array
{
return [
self::TEXT_MESSAGE,
self::FILE_MESSAGE,
self::CODE_MESSAGE
];
}
2021-07-01 23:10:18 +08:00
}