mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 18:36:19 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
edcd883b10
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,7 +5,7 @@ components
|
|||||||
out-test
|
out-test
|
||||||
.github
|
.github
|
||||||
.idea
|
.idea
|
||||||
|
.exe
|
||||||
|
|
||||||
deploy/open_im_api
|
deploy/open_im_api
|
||||||
deploy/open_im_msg_gateway
|
deploy/open_im_msg_gateway
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
}
|
||||||
log.ZInfo(context.Background(), "user rpc conn", "conn", conn)
|
log.ZInfo(context.Background(), "user rpc conn", "conn", conn)
|
||||||
return &User{conn: conn, discov: discov}
|
return &User{conn: conn, discov: discov}
|
||||||
@ -34,7 +34,7 @@ type User struct {
|
|||||||
func (u *User) client(ctx context.Context) (user.UserClient, error) {
|
func (u *User) client(ctx context.Context) (user.UserClient, error) {
|
||||||
conn, err := u.discov.GetConn(ctx, config.Config.RpcRegisterName.OpenImUserName)
|
conn, err := u.discov.GetConn(ctx, config.Config.RpcRegisterName.OpenImUserName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return nil, err
|
||||||
}
|
}
|
||||||
return user.NewUserClient(conn), nil
|
return user.NewUserClient(conn), nil
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,13 @@ func (db *commonMsgDatabase) getMsgBySeqs(ctx context.Context, userID, conversat
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
func (db *commonMsgDatabase) findMsgInfoBySeq(ctx context.Context, userID, docID string, seqs []int64) (totalMsgs []*unRelationTb.MsgInfoModel, err error) {
|
func (db *commonMsgDatabase) findMsgInfoBySeq(ctx context.Context, userID, docID string, seqs []int64) (totalMsgs []*unRelationTb.MsgInfoModel, err error) {
|
||||||
return db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, docID, seqs)
|
msgs, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, docID, seqs)
|
||||||
|
for _, msg := range msgs {
|
||||||
|
if msg.IsRead {
|
||||||
|
msg.Msg.IsRead = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msgs, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *commonMsgDatabase) getMsgBySeqsRange(ctx context.Context, userID string, conversationID string, allSeqs []int64, begin, end int64) (seqMsgs []*sdkws.MsgData, err error) {
|
func (db *commonMsgDatabase) getMsgBySeqsRange(ctx context.Context, userID string, conversationID string, allSeqs []int64, begin, end int64) (seqMsgs []*sdkws.MsgData, err error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user