constant

package
v3.8.0-rc.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdSyncData                   = "001"
	CmdSyncFlag                   = "002"
	CmdNotification               = "003"
	CmdMsgSyncInReinstall         = "004"
	CmdNewMsgCome                 = "005"
	CmdSuperGroupMsgCome          = "006"
	CmdUpdateConversation         = "007"
	CmSyncReactionExtensions      = "008"
	CmdFroceSyncBlackList         = "009"
	CmdForceSyncFriendApplication = "010"
	CmdForceSyncMsg               = "011"
	CmdForceSyncLoginUerInfo      = "012"
	CmdReLogin                    = "013"
	CmdUnInit                     = "014"
	CmdAcceptFriend               = "015"
	CmdRefuseFriend               = "016"
	CmdAddFriend                  = "017"

	CmdJoinedSuperGroup = "018"
	CmdUpdateMessage    = "019"

	CmdReconnect = "020"
	CmdInit      = "021"

	CmdMaxSeq       = "maxSeq"
	CmdPushMsg      = "pushMsg"
	CmdConnSuccesss = "connSuccess"
	CmdWakeUp       = "wakeUp"
	CmdLogOut       = "loginOut"
)
View Source
const (
	//ContentType
	Text                            = 101
	Picture                         = 102
	Sound                           = 103
	Video                           = 104
	File                            = 105
	AtText                          = 106
	Merger                          = 107
	Card                            = 108
	Location                        = 109
	Custom                          = 110
	Typing                          = 113
	Quote                           = 114
	Face                            = 115
	AdvancedText                    = 117
	CustomMsgNotTriggerConversation = 119
	CustomMsgOnlineOnly             = 120
	ReactionMessageModifier         = 121
	ReactionMessageDeleter          = 122

	//////////////////////////////////////////
	NotificationBegin       = 1000
	FriendNotificationBegin = 1200

	FriendApplicationApprovedNotification = 1201 //add_friend_response
	FriendApplicationRejectedNotification = 1202 //add_friend_response
	FriendApplicationNotification         = 1203 //add_friend
	FriendAddedNotification               = 1204
	FriendDeletedNotification             = 1205 //delete_friend
	FriendRemarkSetNotification           = 1206 //set_friend_remark?
	BlackAddedNotification                = 1207 //add_black
	BlackDeletedNotification              = 1208 //remove_black
	FriendInfoUpdatedNotification         = 1209
	FriendsInfoUpdateNotification         = 1210
	FriendNotificationEnd                 = 1299
	ConversationChangeNotification        = 1300

	UserNotificationBegin         = 1301
	UserInfoUpdatedNotification   = 1303 //SetSelfInfoTip             = 204
	UserStatusChangeNotification  = 1304
	UserCommandAddNotification    = 1305
	UserCommandDeleteNotification = 1306
	UserCommandUpdateNotification = 1307

	UserNotificationEnd = 1399
	OANotification      = 1400

	GroupNotificationBegin = 1500

	GroupCreatedNotification                 = 1501
	GroupInfoSetNotification                 = 1502
	JoinGroupApplicationNotification         = 1503
	MemberQuitNotification                   = 1504
	GroupApplicationAcceptedNotification     = 1505
	GroupApplicationRejectedNotification     = 1506
	GroupOwnerTransferredNotification        = 1507
	MemberKickedNotification                 = 1508
	MemberInvitedNotification                = 1509
	MemberEnterNotification                  = 1510
	GroupDismissedNotification               = 1511
	GroupMemberMutedNotification             = 1512
	GroupMemberCancelMutedNotification       = 1513
	GroupMutedNotification                   = 1514
	GroupCancelMutedNotification             = 1515
	GroupMemberInfoSetNotification           = 1516
	GroupMemberSetToAdminNotification        = 1517
	GroupMemberSetToOrdinaryUserNotification = 1518
	GroupInfoSetAnnouncementNotification     = 1519
	GroupInfoSetNameNotification             = 1520
	GroupNotificationEnd                     = 1599

	SignalingNotificationBegin = 1600
	SignalingNotification      = 1601
	SignalingNotificationEnd   = 1649

	SuperGroupNotificationBegin         = 1650
	SuperGroupUpdateNotification        = 1651
	MsgDeleteNotification               = 1652
	ReactionMessageModifierNotification = 1653
	ReactionMessageDeleteNotification   = 1654
	SuperGroupNotificationEnd           = 1699

	ConversationPrivateChatNotification = 1701
	ConversationUnreadNotification      = 1702
	ClearConversationNotification       = 1703

	WorkMomentNotificationBegin = 1900
	WorkMomentNotification      = 1901

	BusinessNotificationBegin = 2000
	BusinessNotification      = 2001
	BusinessNotificationEnd   = 2099

	RevokeNotification = 2101

	HasReadReceiptNotification      = 2150
	GroupHasReadReceiptNotification = 2155

	DeleteMsgsNotification = 2102

	HasReadReceipt = 2200

	NotificationEnd = 5000

	//MsgFrom
	UserMsgType = 100
	SysMsgType  = 200

	/////////////////////////////////////
	//SessionType
	SingleChatType       = 1
	GroupChatType        = 2
	SuperGroupChatType   = 3
	NotificationChatType = 4

	//MsgStatus
	MsgStatusDefault = 0

	MsgStatusSending     = 1
	MsgStatusSendSuccess = 2
	MsgStatusSendFailed  = 3
	MsgStatusHasDeleted  = 4
	MsgStatusFiltered    = 5

	//OptionsKey
	IsHistory                  = "history"
	IsPersistent               = "persistent"
	IsUnreadCount              = "unreadCount"
	IsConversationUpdate       = "conversationUpdate"
	IsOfflinePush              = "offlinePush"
	IsSenderSync               = "senderSync"
	IsNotPrivate               = "notPrivate"
	IsSenderConversationUpdate = "senderConversationUpdate"

	//GroupStatus
	GroupOk              = 0
	GroupBanChat         = 1
	GroupStatusDismissed = 2
	GroupStatusMuted     = 3

	// workMoment permission
	WorkMomentPublic            = 0
	WorkMomentPrivate           = 1
	WorkMomentPermissionCanSee  = 2
	WorkMomentPermissionCantSee = 3

	// workMoment sdk notification type
	WorkMomentCommentNotification = 0
	WorkMomentLikeNotification    = 1
	WorkMomentAtUserNotification  = 2
)
View Source
const (
	BlackRelationship  = 0
	FriendRelationship = 1
)
View Source
const (
	NormalGroup                       = 0
	SuperGroup                        = 1
	WorkingGroup                      = 2
	SuperGroupTableName               = "local_super_groups"
	SuperGroupErrChatLogsTableNamePre = "local_sg_err_chat_logs_"
	ChatLogsTableNamePre              = "chat_logs_"
)

const (

ErrCodeInitLogin    = 1001
ErrCodeFriend       = 2001
ErrCodeConversation = 3001
ErrCodeUserInfo     = 4001
ErrCodeGroup        = 5001

)

View Source
const (
	SdkInit = 0

	LoginSuccess = 101
	Logining     = 102
	LoginFailed  = 103

	Logout = 201

	TokenFailedExpired       = 701
	TokenFailedInvalid       = 702
	TokenFailedKickedOffline = 703
)
View Source
const (
	AddConOrUpLatMsg                  = 2
	UnreadCountSetZero                = 3
	IncrUnread                        = 5
	TotalUnreadMessageChanged         = 6
	UpdateConFaceUrlAndNickName       = 7
	UpdateLatestMessageChange         = 8
	ConChange                         = 9
	NewCon                            = 10
	ConChangeDirect                   = 11
	NewConDirect                      = 12
	ConversationLatestMsgHasRead      = 13
	UpdateMsgFaceUrlAndNickName       = 14
	SyncConversation                  = 15
	SyncMessageListReactionExtensions = 16
	SyncMessageListTypeKeyInfo        = 17
	UpdateUserCommand                 = 18

	HasRead = 1
	NotRead = 0

	IsFilter  = 1
	NotFilter = 0
)
View Source
const (
	GroupActionCreateGroup            = 1
	GroupActionApplyJoinGroup         = 2
	GroupActionQuitGroup              = 3
	GroupActionSetGroupInfo           = 4
	GroupActionKickGroupMember        = 5
	GroupActionTransferGroupOwner     = 6
	GroupActionInviteUserToGroup      = 7
	GroupActionAcceptGroupApplication = 8
	GroupActionRefuseGroupApplication = 9
)
View Source
const (
	FriendAcceptTip  = "You have successfully become friends, so start chatting"
	TransferGroupTip = "The owner of the group is transferred!"
	AcceptGroupTip   = "%s join the group"
)

const MaxTotalMsgLen = 20480

View Source
const (
	GetNewestSeq          = 1001
	PullMsgBySeqList      = 1002
	SendMsg               = 1003
	SendSignalMsg         = 1004
	DelMsg                = 1005
	PushMsg               = 2001
	KickOnlineMsg         = 2002
	LogoutMsg             = 2003
	SetBackgroundStatus   = 2004
	WsSubUserOnlineStatus = 2005

	WSDataError = 3001
)
View Source
const (
	//MsgReceiveOpt
	ReceiveMessage          = 0
	NotReceiveMessage       = 1
	ReceiveNotNotifyMessage = 2

	Online  = 1
	Offline = 0

	//pinned
	Pinned    = 1
	NotPinned = 0

	//privateChat
	IsPrivateChat  = true
	NotPrivateChat = false
)

conversation

View Source
const (
	AppOrdinaryUsers = 1 // Application user type: ordinary user
	AppAdmin         = 2 // Application user type: administrator

	GroupOwner         = 100 // Group member type: owner
	GroupAdmin         = 60  // Group member type: administrator
	GroupOrdinaryUsers = 20  // Group member type: ordinary user

	GroupFilterAll                   = 0
	GroupFilterOwner                 = 1
	GroupFilterAdmin                 = 2
	GroupFilterOrdinaryUsers         = 3
	GroupFilterAdminAndOrdinaryUsers = 4
	GroupFilterOwnerAndAdmin         = 5

	GroupResponseAgree  = 1  // Response to group application: agree
	GroupResponseRefuse = -1 // Response to group application: refuse

	FriendResponseAgree   = 1  // Response to friend request: agree
	FriendResponseRefuse  = -1 // Response to friend request: refuse
	FriendResponseDefault = 0

	Male   = 1 // Gender: male
	Female = 2 // Gender: female
)
View Source
const (
	AtAllString = "AtAllTag" // String for 'all people' mention tag
	AtNormal    = 0          // Mention mode: normal
	AtMe        = 1          // Mention mode: mention sender only
	AtAll       = 2          // Mention mode: mention all people
	AtAllAtMe   = 3          // Mention mode: mention all people and sender

)
View Source
const (
	FieldRecvMsgOpt    = 1 // Field type: message receiving options
	FieldIsPinned      = 2 // Field type: whether a message is pinned
	FieldAttachedInfo  = 3 // Field type: attached information
	FieldIsPrivateChat = 4 // Field type: whether a message is from a private chat
	FieldGroupAtType   = 5 // Field type: group mention mode
	FieldIsNotInGroup  = 6 // Field type: whether a message is not in a group
	FieldEx            = 7 // Field type: extension field
	FieldUnread        = 8 // Field type: whether a message is unread
	FieldBurnDuration  = 9 // Field type: message burn duration
)
View Source
const (
	SetMessageExtensions = 1 // Message extension operation type: set extension
	AddMessageExtensions = 2 // Message extension operation type: add extension
)
View Source
const (
	KeywordMatchOr  = 0 // Keyword match mode: match any keyword
	KeywordMatchAnd = 1 // Keyword match mode: match all keywords
)
View Source
const (
	MsgSyncModelDefault  = 0   //SyncFlag
	MsgSyncModelLogin    = 1   //SyncFlag
	SyncOrderStartLatest = 101 //PullMsgOrder

	MsgSyncBegin      = 1001 //
	MsgSyncProcessing = 1002 //
	MsgSyncEnd        = 1003 //
	MsgSyncFailed     = 1004
	AppDataSyncStart  = 1005
	AppDataSyncFinish = 1006
)
View Source
const (
	JoinByInvitation = 2
	JoinBySearch     = 3
	JoinByQRCode     = 4
)
View Source
const (
	SplitPullMsgNum              = 100
	PullMsgNumWhenLogin          = 10000
	PullMsgNumForReadDiffusion   = 50
	NormalMsgMinNumReadDiffusion = 100
)
View Source
const (
	Uninitialized    = -1001
	NoNetwork        = 1 // Online -> Offline
	NetworkAvailable = 2 // Offline -> Online
	NetworkVariation = 3 // Online, but status changed
)
View Source
const (
	ApplicantReceiver = iota
	AdminReceiver
)

GroupApplicationReceiver

View Source
const (
	//Platform ID
	IOSPlatformID        = 1
	AndroidPlatformID    = 2
	WindowsPlatformID    = 3
	OSXPlatformID        = 4
	WebPlatformID        = 5
	MiniWebPlatformID    = 6
	LinuxPlatformID      = 7
	AndroidPadPlatformID = 8
	IPadPlatformID       = 9
	AdminPlatformID      = 10

	//Platform string match to Platform ID
	IOSPlatformStr        = "IOS"
	AndroidPlatformStr    = "Android"
	WindowsPlatformStr    = "Windows"
	OSXPlatformStr        = "OSX"
	WebPlatformStr        = "Web"
	MiniWebPlatformStr    = "MiniWeb"
	LinuxPlatformStr      = "Linux"
	AndroidPadPlatformStr = "APad"
	IPadPlatformStr       = "IPad"
	AdminPlatformStr      = "Admin"

	//terminal types
	TerminalPC     = "PC"
	TerminalMobile = "Mobile"
)
View Source
const (
	GetSelfUserInfoRouter         = "/user/get_self_user_info"
	GetUsersInfoRouter            = "/user/get_users_info"
	UpdateSelfUserInfoRouter      = "/user/update_user_info"
	UpdateSelfUserInfoExRouter    = "/user/update_user_info_ex"
	SetGlobalRecvMessageOptRouter = "/user/set_global_msg_recv_opt"
	ProcessUserCommandAdd         = "/user/process_user_command_add"
	ProcessUserCommandDelete      = "/user/process_user_command_delete"
	ProcessUserCommandUpdate      = "/user/process_user_command_update"
	ProcessUserCommandGet         = "/user/process_user_command_get"
	ProcessUserCommandGetAll      = "/user/process_user_command_get_all"

	GetUsersInfoFromCacheRouter   = "/user/get_users_info_from_cache"
	AccountCheck                  = "/user/account_check"
	UserRegister                  = "/user/user_register"
	SubscribeUsersStatusRouter    = "/user/subscribe_users_status"
	GetSubscribeUsersStatusRouter = "/user/get_subscribe_users_status"
	GetUserStatusRouter           = "/user/get_users_status"

	AddFriendRouter                    = "/friend/add_friend"
	DeleteFriendRouter                 = "/friend/delete_friend"
	GetFriendApplicationListRouter     = "/friend/get_friend_apply_list"      //recv
	GetSelfFriendApplicationListRouter = "/friend/get_self_friend_apply_list" //send
	ImportFriendListRouter             = "/friend/import_friend"

	GetDesignatedFriendsApplyRouter = "/friend/get_designated_friend_apply"
	GetFriendListRouter             = "/friend/get_friend_list"
	GetDesignatedFriendsRouter      = "/friend/get_designated_friends"
	AddFriendResponse               = "/friend/add_friend_response"
	SetFriendRemark                 = "/friend/set_friend_remark"
	UpdateFriends                   = "/friend/update_friends"
	GetIncrementalFriends           = "/friend/get_incremental_friends"
	GetFullFriendUserIDs            = "/friend/get_full_friend_user_ids"

	AddBlackRouter     = "/friend/add_black"
	RemoveBlackRouter  = "/friend/remove_black"
	GetBlackListRouter = "/friend/get_black_list"

	PullUserMsgRouter      = "/chat/pull_msg"
	PullUserMsgBySeqRouter = "/chat/pull_msg_by_seq"
	NewestSeqRouter        = "/chat/newest_seq"

	// msg
	ClearConversationMsgRouter             = RouterMsg + "/clear_conversation_msg" // Clear the message of the specified conversation
	ClearAllMsgRouter                      = RouterMsg + "/user_clear_all_msg"     // Clear all messages of the current user
	DeleteMsgsRouter                       = RouterMsg + "/delete_msgs"            // Delete the specified message
	RevokeMsgRouter                        = RouterMsg + "/revoke_msg"
	SetMessageReactionExtensionsRouter     = RouterMsg + "/set_message_reaction_extensions"
	AddMessageReactionExtensionsRouter     = RouterMsg + "/add_message_reaction_extensions"
	MarkMsgsAsReadRouter                   = RouterMsg + "/mark_msgs_as_read"
	GetConversationsHasReadAndMaxSeqRouter = RouterMsg + "/get_conversations_has_read_and_max_seq"

	MarkConversationAsRead    = RouterMsg + "/mark_conversation_as_read"
	MarkMsgsAsRead            = RouterMsg + "/mark_msgs_as_read"
	SetConversationHasReadSeq = RouterMsg + "/set_conversation_has_read_seq"
	SendMsgRouter             = RouterMsg + "/send_msg"
	GetServerTimeRouter       = RouterMsg + "/get_server_time"

	GetMessageListReactionExtensionsRouter = RouterMsg + "/get_message_list_reaction_extensions"
	DeleteMessageReactionExtensionsRouter  = RouterMsg + "/delete_message_reaction_extensions"

	TencentCloudStorageCredentialRouter = "/third/tencent_cloud_storage_credential"
	AliOSSCredentialRouter              = "/third/ali_oss_credential"
	MinioStorageCredentialRouter        = "/third/minio_storage_credential"
	AwsStorageCredentialRouter          = "/third/aws_storage_credential"

	// group
	CreateGroupRouter                 = RouterGroup + "/create_group"
	SetGroupInfoRouter                = RouterGroup + "/set_group_info"
	JoinGroupRouter                   = RouterGroup + "/join_group"
	QuitGroupRouter                   = RouterGroup + "/quit_group"
	GetGroupsInfoRouter               = RouterGroup + "/get_groups_info"
	GetGroupMemberListRouter          = RouterGroup + "/get_group_member_list"
	GetGroupAllMemberListRouter       = RouterGroup + "/get_group_all_member_list"
	GetGroupMembersInfoRouter         = RouterGroup + "/get_group_members_info"
	InviteUserToGroupRouter           = RouterGroup + "/invite_user_to_group"
	GetJoinedGroupListRouter          = RouterGroup + "/get_joined_group_list"
	KickGroupMemberRouter             = RouterGroup + "/kick_group"
	TransferGroupRouter               = RouterGroup + "/transfer_group"
	GetRecvGroupApplicationListRouter = RouterGroup + "/get_recv_group_applicationList"
	GetSendGroupApplicationListRouter = RouterGroup + "/get_user_req_group_applicationList"
	AcceptGroupApplicationRouter      = RouterGroup + "/group_application_response"
	RefuseGroupApplicationRouter      = RouterGroup + "/group_application_response"
	DismissGroupRouter                = RouterGroup + "/dismiss_group"
	MuteGroupMemberRouter             = RouterGroup + "/mute_group_member"
	CancelMuteGroupMemberRouter       = RouterGroup + "/cancel_mute_group_member"
	MuteGroupRouter                   = RouterGroup + "/mute_group"
	CancelMuteGroupRouter             = RouterGroup + "/cancel_mute_group"
	SetGroupMemberNicknameRouter      = RouterGroup + "/set_group_member_nickname"
	SetGroupMemberInfoRouter          = RouterGroup + "/set_group_member_info"
	GetGroupAbstractInfoRouter        = RouterGroup + "/get_group_abstract_info"
	//SearchGroupMember                 = RouterGroup + "/search_group_member"
	GetIncrementalJoinGroup        = RouterGroup + "/get_incremental_join_groups"
	GetIncrementalGroupMemberBatch = RouterGroup + "/get_incremental_group_members_batch"
	GetFullJoinedGroupIDs          = RouterGroup + "/get_full_join_group_ids"
	GetFullGroupMemberUserIDs      = RouterGroup + "/get_full_group_member_user_ids"

	SetReceiveMessageOptRouter         = "/conversation/set_receive_message_opt"
	GetReceiveMessageOptRouter         = "/conversation/get_receive_message_opt"
	GetAllConversationMessageOptRouter = "/conversation/get_all_conversation_message_opt"
	SetConversationOptRouter           = ConversationGroup + "/set_conversation"
	GetConversationsRouter             = ConversationGroup + "/get_conversations"
	GetAllConversationsRouter          = ConversationGroup + "/get_all_conversations"
	GetConversationRouter              = ConversationGroup + "/get_conversation"
	BatchSetConversationRouter         = ConversationGroup + "/batch_set_conversation"
	ModifyConversationFieldRouter      = ConversationGroup + "/modify_conversation_field"
	SetConversationsRouter             = ConversationGroup + "/set_conversations"
	GetIncrementalConversation         = ConversationGroup + "/get_incremental_conversations"
	GetFullConversationIDs             = ConversationGroup + "/get_full_conversation_ids"
	GetOwnerConversationRouter         = ConversationGroup + "/get_owner_conversation"

	// organization
	GetSubDepartmentRouter    = RouterOrganization + "/get_sub_department"
	GetDepartmentMemberRouter = RouterOrganization + "/get_department_member"
	ParseTokenRouter          = RouterAuth + "/parse_token"

	// super_group
	GetJoinedSuperGroupListRouter = RouterSuperGroup + "/get_joined_group_list"
	GetSuperGroupsInfoRouter      = RouterSuperGroup + "/get_groups_info"

	// third
	FcmUpdateTokenRouter = RouterThird + "/fcm_update_token"
	SetAppBadgeRouter    = RouterThird + "/set_app_badge"
	UploadLogsRouter     = RouterThird + "/logs/upload"

	// auth
	GetUsersToken = RouterAuth + "/user_token"
)
View Source
const (
	RouterGroup        = "/group"
	ConversationGroup  = "/conversation"
	RouterOrganization = "/organization"
	RouterAuth         = "/auth"
	RouterSuperGroup   = "/super_group"
	RouterMsg          = "/msg"
	RouterThird        = "/third"
)
View Source
const (
	ObjectPartLimit               = "/object/part_limit"
	ObjectPartSize                = "/object/part_size"
	ObjectInitiateMultipartUpload = "/object/initiate_multipart_upload"
	ObjectAuthSign                = "/object/auth_sign"
	ObjectCompleteMultipartUpload = "/object/complete_multipart_upload"
	ObjectAccessURL               = "/object/access_url"
)
View Source
const BigVersion = "v3"
View Source
const (
	DeFaultSuccessMsg = "ok"
)
View Source
const MaxTotalMsgLen = 51200
View Source
const SplitGetGroupMemberNum = 1000
View Source
const SuccessCallbackDefault = "" // Default value for success callback
View Source
const UseHashGroupMemberNum = 1000
View Source
const ZoomScale = "200"

Variables

Functions

func PlatformIDToName

func PlatformIDToName(num int) string

func PlatformNameToClass

func PlatformNameToClass(name string) string

func PlatformNameToID

func PlatformNameToID(name string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL