Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove repeat platform on online status. #1221

Merged
merged 143 commits into from
Oct 18, 2023
Merged
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
a99b6a1
fix: to start im or chat, ZooKeeper must be started first.
FGadvancer Jul 20, 2023
5cc7483
fix: msg gateway start output err info
FGadvancer Jul 20, 2023
78daeec
Merge remote-tracking branch 'upstream/main'
FGadvancer Jul 26, 2023
f0227ef
fix: msg gateway start output err info
FGadvancer Jul 26, 2023
eaeb342
chore: package path changes
withchao Jul 26, 2023
be0abdd
Merge remote-tracking branch 'origin/main'
withchao Jul 26, 2023
6b1e201
fix: go mod update
FGadvancer Jul 26, 2023
4fc70a7
Merge remote-tracking branch 'origin/main'
withchao Jul 26, 2023
ce81f6b
fix: token update
FGadvancer Jul 26, 2023
0ed8022
chore: package path changes
withchao Jul 26, 2023
f4c31ea
Merge remote-tracking branch 'origin/main'
withchao Jul 26, 2023
ac14dd0
chore: package path changes
withchao Jul 26, 2023
49220cc
fix: token update
FGadvancer Jul 26, 2023
d4d88d5
fix: token update
FGadvancer Jul 26, 2023
82e5319
fix: token update
FGadvancer Jul 26, 2023
445c34d
fix: token update
FGadvancer Jul 26, 2023
177a163
fix: token update
FGadvancer Jul 26, 2023
bc70c5b
fix: token update
FGadvancer Jul 27, 2023
0c1bbd0
fix: token update
FGadvancer Jul 27, 2023
ba6013d
fix: get all userID
FGadvancer Jul 28, 2023
7eeb3d6
fix: get all userID
FGadvancer Jul 28, 2023
a99e54d
fix: msggateway add online status call
FGadvancer Jul 28, 2023
a6fd0f9
Merge remote-tracking branch 'upstream/main'
FGadvancer Jul 31, 2023
82d7255
refactor: log change
FGadvancer Aug 7, 2023
3b74ad3
refactor: log change
FGadvancer Aug 9, 2023
3ffbb90
chore: network mode change
FGadvancer Aug 10, 2023
bbb9f85
Merge branch 'main' into main
cubxxw Aug 10, 2023
cdbd4d5
feat: fetch origin
FGadvancer Aug 14, 2023
89c0dc4
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 14, 2023
0af4964
cicd: robot automated Change
FGadvancer Aug 14, 2023
8744acc
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 15, 2023
bd118ba
cicd: robot automated Change
FGadvancer Aug 15, 2023
edc2f79
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 17, 2023
33f9e28
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 17, 2023
c7bbe6a
cicd: robot automated Change
FGadvancer Aug 17, 2023
2639ecb
feat: add api of get server time
FGadvancer Aug 17, 2023
0cc5125
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 17, 2023
233c1e3
feat: remove go work sum
FGadvancer Aug 17, 2023
407dff2
feat: sync upstream
FGadvancer Aug 17, 2023
56bcb57
cicd: robot automated Change
FGadvancer Aug 17, 2023
f4b0c79
fix: pull message add isRead field
FGadvancer Aug 17, 2023
cd87175
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 17, 2023
014c3b7
fix: check msg-transfer script
FGadvancer Aug 17, 2023
63c1778
fix: script update
FGadvancer Aug 17, 2023
a5c412c
fix: script update
FGadvancer Aug 17, 2023
5b5d6c3
fix: script update
FGadvancer Aug 17, 2023
7448473
fix: script update
FGadvancer Aug 17, 2023
0721fb7
fix: script update
FGadvancer Aug 17, 2023
0538859
fix: script update
FGadvancer Aug 17, 2023
a63fa37
fix: script update
FGadvancer Aug 17, 2023
32a2614
fix: script update
FGadvancer Aug 17, 2023
d88e778
fix: script update
FGadvancer Aug 17, 2023
975b9ef
fix: script update
FGadvancer Aug 17, 2023
8c05b27
fix: script update
FGadvancer Aug 17, 2023
6021080
fix: script update
FGadvancer Aug 17, 2023
6038341
fix: script update
FGadvancer Aug 17, 2023
9e65261
fix: script update
FGadvancer Aug 17, 2023
8361e35
fix: script update
FGadvancer Aug 17, 2023
e6fd555
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 17, 2023
fc243d3
fix: script update
FGadvancer Aug 17, 2023
1d7ec29
fix: script update
FGadvancer Aug 17, 2023
729b18d
Merge branch 'main' into main
FGadvancer Aug 17, 2023
dc41979
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 17, 2023
ac7e909
fix: start don't kill old process
FGadvancer Aug 17, 2023
1c751db
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 18, 2023
ac29fd6
cicd: robot automated Change
FGadvancer Aug 18, 2023
e2c90d7
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 18, 2023
a77c47e
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 18, 2023
a1bdb01
fix: check component
FGadvancer Aug 18, 2023
4f69dd4
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 18, 2023
e49e347
fix: pull message set isRead only message come from single.
FGadvancer Aug 21, 2023
0d5e57a
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 23, 2023
ac3a121
cicd: robot automated Change
FGadvancer Aug 23, 2023
ef5454b
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 23, 2023
80ddb91
fix: multiple gateway kick user each other.
FGadvancer Aug 24, 2023
1c6b2de
fix: multiple gateway kick user each other.
FGadvancer Aug 24, 2023
fb7e6d3
fix: multiple gateway kick user each other.
FGadvancer Aug 24, 2023
af03e63
fix: multiple gateway kick user each other.
FGadvancer Aug 24, 2023
2c876c0
fix: multiple gateway kick user each other.
FGadvancer Aug 24, 2023
4597aa0
fix: multiple gateway kick user each other.
FGadvancer Aug 25, 2023
04baf60
Merge remote-tracking branch 'upstream/main'
FGadvancer Aug 25, 2023
fee722e
cicd: robot automated Change
FGadvancer Aug 25, 2023
a9c6e30
fix: multiple gateway kick user each other.
FGadvancer Aug 25, 2023
ceb0c6c
Merge remote-tracking branch 'origin/main'
FGadvancer Aug 25, 2023
d057f60
fix: add ex field to update group info.
FGadvancer Aug 25, 2023
897f8bf
fix: add ex field to update group info.
FGadvancer Aug 25, 2023
7d95544
fix: merge main code
FGadvancer Sep 1, 2023
2473521
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 1, 2023
f5609a6
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 1, 2023
48d0430
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 5, 2023
8c2c9d7
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 7, 2023
af23599
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 7, 2023
af260b9
cicd: robot automated Change
FGadvancer Sep 7, 2023
1ebcef4
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 7, 2023
ec3357b
cicd: robot automated Change
FGadvancer Sep 7, 2023
ee1410d
refactor: change project module name.
FGadvancer Sep 7, 2023
895bef5
Merge remote-tracking branch 'origin/main'
FGadvancer Sep 7, 2023
bd2dda0
refactor: change project module name.
FGadvancer Sep 7, 2023
efac72e
refactor: change project module name.
FGadvancer Sep 7, 2023
a9aae98
cicd: robot automated Change
FGadvancer Sep 7, 2023
6deeccc
test: for pressure test.
FGadvancer Sep 8, 2023
a9bc24d
Merge remote-tracking branch 'origin/main'
FGadvancer Sep 8, 2023
8b34d36
test: for pressure test.
FGadvancer Sep 8, 2023
bfd7f49
test: for pressure test.
FGadvancer Sep 8, 2023
e37d65f
feat: merge open source code into main.
FGadvancer Sep 12, 2023
8b18837
test: message log.
FGadvancer Sep 18, 2023
dd6a586
cicd: robot automated Change
FGadvancer Sep 18, 2023
f185f09
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 19, 2023
8d9e112
fxi: component check output valid info.
FGadvancer Sep 19, 2023
b21db97
fxi: component check output valid info.
FGadvancer Sep 19, 2023
7541285
test: send message test log.
FGadvancer Sep 19, 2023
4ecf684
cicd: robot automated Change
FGadvancer Sep 19, 2023
7a856ab
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 19, 2023
b048f1d
cicd: robot automated Change
FGadvancer Sep 19, 2023
bc9c20a
test: remove info log.
FGadvancer Sep 19, 2023
2efb11f
Merge remote-tracking branch 'origin/main'
FGadvancer Sep 19, 2023
8b278da
feat: api of send message add sendTime field.
FGadvancer Sep 19, 2023
f089d1d
Merge branch 'openimsdk:main' into main
FGadvancer Sep 20, 2023
eadcacd
fix: add callback for update user's info.
FGadvancer Sep 20, 2023
9b7b359
cicd: robot automated Change
FGadvancer Sep 20, 2023
1ab2210
fix: change callback command name.
FGadvancer Sep 20, 2023
d56e989
Merge branch 'main' of https://github.com/FGadvancer/Open-IM-Server
FGadvancer Sep 20, 2023
e71b4a8
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 25, 2023
91f7e5c
Merge remote-tracking branch 'upstream/main'
FGadvancer Sep 28, 2023
cfa4a9b
Merge remote-tracking branch 'upstream/main'
FGadvancer Oct 7, 2023
158e6f7
Merge remote-tracking branch 'upstream/main'
FGadvancer Oct 8, 2023
201e780
Merge remote-tracking branch 'upstream/main'
FGadvancer Oct 8, 2023
d0b0086
cicd: robot automated Change
FGadvancer Oct 8, 2023
b26b227
fix: single chat unread status change.
FGadvancer Oct 9, 2023
4a2a39c
Merge remote-tracking branch 'origin/main'
FGadvancer Oct 9, 2023
f2af824
fix: single chat unread status change.
FGadvancer Oct 9, 2023
8c787b0
fix: single chat unread status change.
FGadvancer Oct 9, 2023
5147467
fix: user status change.
FGadvancer Oct 10, 2023
1ebcbc0
cicd: robot automated Change
FGadvancer Oct 10, 2023
32b5028
fix: user status change.
FGadvancer Oct 10, 2023
60422a9
fix: user status change.
FGadvancer Oct 10, 2023
9a29a32
fix: user status change.
FGadvancer Oct 10, 2023
5b6c747
fix: merge main into server.
FGadvancer Oct 12, 2023
5b890e3
cicd: robot automated Change
FGadvancer Oct 12, 2023
f0a1b2d
fix: ws close when user logout.
FGadvancer Oct 12, 2023
2a8593b
Merge remote-tracking branch 'origin/main'
FGadvancer Oct 12, 2023
2f1595e
Merge remote-tracking branch 'upstream/main'
FGadvancer Oct 13, 2023
8620e0e
fix: remove repeat platform on online status.
FGadvancer Oct 13, 2023
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
21 changes: 20 additions & 1 deletion pkg/common/db/cache/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ func (u *UserCacheRedis) SetUserStatus(ctx context.Context, userID string, statu
if err != nil {
return errs.Wrap(err)
}
onlineStatus.PlatformIDs = RemoveRepeatedElementsInList(append(onlineStatus.PlatformIDs, platformID))
} else {
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, platformID)
}
onlineStatus.Status = constant.Online
onlineStatus.UserID = userID
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, platformID)
newjsonData, err := json.Marshal(&onlineStatus)
if err != nil {
return errs.Wrap(err)
Expand All @@ -304,3 +306,20 @@ func (u *UserCacheRedis) SetUserStatus(ctx context.Context, userID string, statu

return nil
}

type Comparable interface {
~int | ~string | ~float64 | ~int32
}

func RemoveRepeatedElementsInList[T Comparable](slc []T) []T {
var result []T
tempMap := map[T]struct{}{}
for _, e := range slc {
if _, found := tempMap[e]; !found {
tempMap[e] = struct{}{}
result = append(result, e)
}
}

return result
}
Loading