Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions open_im_sdk/userRelated.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,11 @@ func (u *LoginMgr) setAppBackgroundStatus(ctx context.Context, isBackground bool
return err
} else {
u.longConnMgr.SetBackground(isBackground)
if isBackground == false {
if !isBackground {
_ = common.TriggerCmdWakeUp(u.heartbeatCmdCh)
_ = common.TriggerCmdSyncData(u.conversationCh)
_ = common.TriggerCmdSyncData(ctx, u.conversationCh)
}

return nil
}
}
4 changes: 2 additions & 2 deletions pkg/common/trigger_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func TriggerCmdWakeUp(ch chan Cmd2Value) error {
return sendCmd(ch, c2v, 100)
}

func TriggerCmdSyncData(ch chan Cmd2Value) error {
func TriggerCmdSyncData(ctx context.Context, ch chan Cmd2Value) error {
if ch == nil {
return errs.Wrap(ErrChanNil)
}
c2v := Cmd2Value{Cmd: constant.CmdSyncData, Value: nil}
c2v := Cmd2Value{Cmd: constant.CmdSyncData, Value: nil, Ctx: ctx}
return sendCmd(ch, c2v, 100)
}

Expand Down