Files
open-im-server/pkg/common/constant/constant.go
T

135 lines
3.4 KiB
Go
Raw Normal View History

2021-05-26 19:37:10 +08:00
package constant
const (
//group admin
2021-06-28 15:31:36 +08:00
OrdinaryMember = 0
2021-07-15 11:14:46 +08:00
GroupOwner = 1
2021-06-28 15:31:36 +08:00
Administrator = 2
//group application
Application = 0
AgreeApplication = 1
2021-12-23 17:22:49 +08:00
//friend related
2021-06-28 15:31:36 +08:00
BlackListFlag = 1
ApplicationFriendFlag = 0
FriendFlag = 1
RefuseFriendFlag = -1
2021-05-26 19:37:10 +08:00
//Websocket Protocol
WSGetNewestSeq = 1001
WSPullMsg = 1002
WSSendMsg = 1003
WSPullMsgBySeqList = 1004
WSPushMsg = 2001
2021-11-25 14:12:52 +08:00
WSKickOnlineMsg = 2002
WSDataError = 3001
2021-05-26 19:37:10 +08:00
///ContentType
//UserRelated
Text = 101
Picture = 102
Voice = 103
Video = 104
File = 105
AtText = 106
Merger = 107
Card = 108
Location = 109
Custom = 110
2021-12-23 17:22:26 +08:00
Revoke = 111
HasReadReceipt = 112
Typing = 113
Quote = 114
Common = 200
GroupMsg = 201
2021-05-26 19:37:10 +08:00
//SysRelated
2021-12-24 15:02:47 +08:00
FriendApplicationAddedNotification = 201
FriendApplicationProcessedNotification = 202
FriendAddedNotification = 203
FriendDeletedNotification = 204
FriendInfoChangedNotification = 205
BlackAddedNotification = 206
BlackDeletedNotification = 207
//AcceptFriendApplicationTip = 201
//AddFriendTip = 202
//RefuseFriendApplicationTip = 203
2021-06-28 15:31:36 +08:00
2021-12-24 15:02:47 +08:00
SelfInfoUpdatedNotification = 301
GroupCreatedNotification = 501
JoinApplicationNotification = 502
ApplicationProcessedNotification = 503
MemberInvitedNotification = 504
MemberKickedNotification = 505
GroupInfoChangedNotification = 506
MemberLeaveNotification = 507
MemberEnterNotification = 508
//TransferGroupOwnerTip = 501
//CreateGroupTip = 502
//GroupApplicationResponseTip = 503
//ApplyJoinGroupTip = 504
//QuitGroupTip = 505
//SetGroupInfoTip = 506
//AcceptGroupApplicationTip = 507
//RefuseGroupApplicationTip = 508
//KickGroupMemberTip = 509
//InviteUserToGroupTip = 510
//ChangeGroupInfoTip = 511
2021-05-26 19:37:10 +08:00
//MsgFrom
UserMsgType = 100
SysMsgType = 200
//SessionType
SingleChatType = 1
GroupChatType = 2
2021-11-25 14:12:52 +08:00
//token
NormalToken = 0
InValidToken = 1
KickedToken = 2
ExpiredToken = 3
//MultiTerminalLogin
//全端登录,但是同端互斥
AllLoginButSameTermKick = 1
//所有端中只能有一端能够登录
SingleTerminalLogin = 2
//web端可以同时在线,其他端只能有一端登录
WebAndOther = 3
//Pc端互斥,移动端互斥,但是web端可以同时在线
PcMobileAndWeb = 4
2021-11-29 16:26:57 +08:00
2021-11-29 18:24:39 +08:00
OnlineStatus = "online"
OfflineStatus = "offline"
2021-12-17 14:28:43 +08:00
Registered = "registered"
UnRegistered = "unregistered"
2021-12-06 16:06:19 +08:00
//MsgReceiveOpt
ReceiveMessage = 0
NotReceiveMessage = 1
ReceiveNotNotifyMessage = 2
2021-12-23 17:22:26 +08:00
//OptionsKey
IsHistory = "history"
IsPersistent = "persistent"
IsOfflinePush = "offlinePush"
IsUnreadCount = "unreadCount"
IsConversationUpdate = "conversationUpdate"
IsSenderSync = "senderSync"
2021-05-26 19:37:10 +08:00
)
var ContentType2PushContent = map[int64]string{
Picture: "[图片]",
Voice: "[语音]",
Video: "[视频]",
File: "[文件]",
Text: "你收到了一条文本消息",
AtText: "[有人@你]",
GroupMsg: "你收到一条群聊消息",
Common: "你收到一条新消息",
2021-05-26 19:37:10 +08:00
}
2021-09-26 14:26:45 +08:00
const FriendAcceptTip = "You have successfully become friends, so start chatting"