Skip to content

Commit 4b751b4

Browse files
committed
fix: text message not save issue
1 parent 125d986 commit 4b751b4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

common/constant/constant.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const (
77
MESSAGE_TYPE_USER = 1
88
MESSAGE_TYPE_GROUP = 2
99

10+
TEXT = 1
1011
FILE = 2
1112
IMAGE = 3
1213
AUDIO = 4

server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (s *Server) Start() {
6363

6464
if msg.To != "" {
6565
// 一般消息,比如文本消息,视频文件消息等
66-
if msg.ContentType >= constant.FILE && msg.ContentType <= constant.VIDEO {
66+
if msg.ContentType >= constant.TEXT && msg.ContentType <= constant.VIDEO {
6767
saveMessage(msg)
6868
if msg.MessageType == constant.MESSAGE_TYPE_USER {
6969
client, ok := s.Clients[msg.To]

0 commit comments

Comments
 (0)