diff --git a/CHANGELOG/.chglog/CHANGELOG.tpl.md b/CHANGELOG/.chglog/CHANGELOG.tpl.md
deleted file mode 100644
index 100a29ed8..000000000
--- a/CHANGELOG/.chglog/CHANGELOG.tpl.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# Version logging for OpenIM
-
-
-
-
-
-{{ if .Versions -}}
-
-## [Unreleased]
-
-{{ if .Unreleased.CommitGroups -}}
-{{ range .Unreleased.CommitGroups -}}
-### {{ .Title }}
-{{ range .Commits -}}
-- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
-{{ end }}
-{{ end -}}
-{{ end -}}
-{{ end -}}
-
-{{ range .Versions }}
-
-## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
-{{ range .CommitGroups -}}
-### {{ .Title }}
-{{ range .Commits -}}
-- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
-{{ end }}
-{{ end -}}
-
-{{- if .RevertCommits -}}
-### Reverts
-{{ range .RevertCommits -}}
-- {{ .Revert.Header }}
-{{ end }}
-{{ end -}}
-
-{{- if .MergeCommits -}}
-### Pull Requests
-{{ range .MergeCommits -}}
-- {{ .Header }}
-{{ end }}
-{{ end -}}
-
-{{- if .NoteGroups -}}
-{{ range .NoteGroups -}}
-### {{ .Title }}
-{{ range .Notes }}
-{{ .Body }}
-{{ end }}
-{{ end -}}
-{{ end -}}
-{{ end -}}
-
-{{- if .Versions }}
-[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
-{{ range .Versions -}}
-{{ if .Tag.Previous -}}
-[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
-{{ end -}}
-{{ end -}}
-{{ end -}}
\ No newline at end of file
diff --git a/CHANGELOG/.chglog/config.yml b/CHANGELOG/.chglog/config.yml
deleted file mode 100644
index 2a45bc26a..000000000
--- a/CHANGELOG/.chglog/config.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-bin: git
-style: github
-template: CHANGELOG.tpl.md
-info:
- title: CHANGELOG
- repository_url: https://github.com/openimsdk/open-im-server
-options:
- tag_filter_pattern: '^v'
- sort: "date"
-
- commits:
- filters:
- Type:
- - feat
- - fix
- - perf
- - refactor
- - docs
- - test
- - chore
- - ci
- - build
- sort_by: Scope
-
- commit_groups:
- group_by: Type
- sort_by: Title
- title_order:
- - feat
- - fix
- - perf
- - refactor
- - docs
- - test
- - chore
- - ci
- - build
- title_maps:
- feat: Features
-
- header:
- pattern: ""
- pattern_maps:
- - PropName
-
- issues:
- prefix:
- - #
-
- refs:
- actions:
- - Closes
- - Fixes
-
- merges:
- pattern: "^Merge branch '(\\w+)'$"
- pattern_maps:
- - Source
-
- reverts:
- pattern: "^Revert \"([\\s\\S]*)\"$"
- pattern_maps:
- - Header
-
- notes:
- keywords:
- - BREAKING CHANGE
\ No newline at end of file
diff --git a/build/goreleaser.yaml b/build/goreleaser.yaml
index 93fe9f4c8..c24fb65da 100644
--- a/build/goreleaser.yaml
+++ b/build/goreleaser.yaml
@@ -53,15 +53,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-cmdutils
id: openim-cmdutils
@@ -71,15 +64,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-crontask
id: openim-crontask
@@ -89,15 +75,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-msggateway
id: openim-msggateway
@@ -107,15 +86,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-msgtransfer
id: openim-msgtransfer
@@ -125,15 +97,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-push
id: openim-push
@@ -143,15 +108,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-auth
id: openim-rpc-auth
@@ -161,15 +119,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-conversation
id: openim-rpc-conversation
@@ -179,15 +130,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-friend
id: openim-rpc-friend
@@ -197,15 +141,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-group
id: openim-rpc-group
@@ -215,15 +152,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-msg
id: openim-rpc-msg
@@ -233,15 +163,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-third
id: openim-rpc-third
@@ -251,15 +174,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
- binary: openim-rpc-user
id: openim-rpc-user
@@ -269,15 +185,8 @@ builds:
- windows
- linux
goarch:
- - s390x
- - mips64
- - mips64le
- amd64
- - ppc64le
- arm64
- goarm:
- - "6"
- - "7"
# TODOļ¼Need a script, such as the init - release to help binary to find the right directory
diff --git a/go.mod b/go.mod
index aea5360d7..b982bc7d0 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/gorilla/websocket v1.5.1
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/mitchellh/mapstructure v1.5.0
- github.com/openimsdk/protocol v0.0.72-alpha.45
+ github.com/openimsdk/protocol v0.0.72-alpha.46
github.com/openimsdk/tools v0.0.50-alpha.16
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0
diff --git a/go.sum b/go.sum
index 473272660..df9cf5194 100644
--- a/go.sum
+++ b/go.sum
@@ -319,8 +319,8 @@ github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y=
github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCFsz7t7vbv7Y=
github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
-github.com/openimsdk/protocol v0.0.72-alpha.45 h1:xTxEG/NzBw/ZxLggqz76l7rl9HUfg7Kb2xS+jU0G2E4=
-github.com/openimsdk/protocol v0.0.72-alpha.45/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
+github.com/openimsdk/protocol v0.0.72-alpha.46 h1:1LZlfEHLzw1F4afFmqBczmXKJWm5rUQ+yr8rJ4oyEAc=
+github.com/openimsdk/protocol v0.0.72-alpha.46/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
github.com/openimsdk/tools v0.0.50-alpha.16 h1:bC1AQvJMuOHtZm8LZRvN8L5mH1Ws2VYdL+TLTs1iGSc=
github.com/openimsdk/tools v0.0.50-alpha.16/go.mod h1:h1cYmfyaVtgFbKmb1Cfsl8XwUOMTt8ubVUQrdGtsUh4=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
diff --git a/internal/push/offlinepush/offlinepusher.go b/internal/push/offlinepush/offlinepusher.go
index 9aa6625de..d655a924a 100644
--- a/internal/push/offlinepush/offlinepusher.go
+++ b/internal/push/offlinepush/offlinepusher.go
@@ -23,10 +23,13 @@ import (
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
+ "github.com/openimsdk/tools/log"
+ "github.com/openimsdk/tools/mcontext"
+ "strings"
)
const (
- geTUI = "geTui"
+ geTUI = "getui"
firebase = "fcm"
jPush = "jpush"
)
@@ -38,6 +41,7 @@ type OfflinePusher interface {
func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (OfflinePusher, error) {
var offlinePusher OfflinePusher
+ pushConf.Enable = strings.ToLower(pushConf.Enable)
switch pushConf.Enable {
case geTUI:
offlinePusher = getui.NewClient(pushConf, cache)
@@ -47,6 +51,7 @@ func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPa
offlinePusher = jpush.NewClient(pushConf)
default:
offlinePusher = dummy.NewClient()
+ log.ZWarn(mcontext.WithMustInfoCtx([]string{"push start", "admin", "admin", ""}), "Unknown push config", nil)
}
return offlinePusher, nil
}
diff --git a/internal/push/offlinepush_handler.go b/internal/push/offlinepush_handler.go
index bf69aed3e..a80c147f4 100644
--- a/internal/push/offlinepush_handler.go
+++ b/internal/push/offlinepush_handler.go
@@ -55,6 +55,9 @@ func (o *OfflinePushConsumerHandler) handleMsg2OfflinePush(ctx context.Context,
log.ZError(ctx, "offline push msg is empty", errs.New("offlinePushMsg is empty"), "userIDs", offlinePushMsg.UserIDs, "msg", offlinePushMsg.MsgData)
return
}
+ if offlinePushMsg.MsgData.Status == constant.MsgStatusSending {
+ offlinePushMsg.MsgData.Status = constant.MsgStatusSendSuccess
+ }
log.ZInfo(ctx, "receive to OfflinePush MQ", "userIDs", offlinePushMsg.UserIDs, "msg", offlinePushMsg.MsgData)
err := o.offlinePushMsg(ctx, offlinePushMsg.MsgData, offlinePushMsg.UserIDs)
diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go
index 4ecf20de5..41ad5962a 100644
--- a/internal/push/push_handler.go
+++ b/internal/push/push_handler.go
@@ -194,6 +194,9 @@ func (c *ConsumerHandler) shouldPushOffline(_ context.Context, msg *sdkws.MsgDat
}
func (c *ConsumerHandler) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.MsgData, pushToUserIDs []string) ([]*msggateway.SingleMsgToUserResults, error) {
+ if msg != nil && msg.Status == constant.MsgStatusSending {
+ msg.Status = constant.MsgStatusSendSuccess
+ }
onlineUserIDs, offlineUserIDs, err := c.onlineCache.GetUsersOnline(ctx, pushToUserIDs)
if err != nil {
return nil, err
diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go
index 57560a28e..b8e6c2aca 100644
--- a/internal/rpc/group/group.go
+++ b/internal/rpc/group/group.go
@@ -1621,7 +1621,7 @@ func (g *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbgroup.SetGr
g.notification.GroupMemberSetToOrdinaryUserNotification(ctx, member.GroupID, member.UserID)
}
}
- if member.Nickname != nil || member.FaceURL != nil || member.Ex != nil {
+ if member.Nickname != nil || member.FaceURL != nil || member.Ex != nil || member.RoleLevel != nil {
g.notification.GroupMemberInfoSetNotification(ctx, member.GroupID, member.UserID)
}
}
diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go
index a16ca5665..2c3f8c0a3 100644
--- a/internal/rpc/msg/send.go
+++ b/internal/rpc/msg/send.go
@@ -29,7 +29,6 @@ import (
"github.com/openimsdk/tools/log"
"github.com/openimsdk/tools/mcontext"
"github.com/openimsdk/tools/utils/datautil"
- "github.com/openimsdk/tools/utils/stringutil"
)
func (m *msgServer) SendMsg(ctx context.Context, req *pbmsg.SendMsgReq) (*pbmsg.SendMsgResp, error) {
@@ -80,13 +79,17 @@ func (m *msgServer) sendMsgGroupChat(ctx context.Context, req *pbmsg.SendMsgReq)
func (m *msgServer) setConversationAtInfo(nctx context.Context, msg *sdkws.MsgData) {
log.ZDebug(nctx, "setConversationAtInfo", "msg", msg)
+
ctx := mcontext.NewCtx("@@@" + mcontext.GetOperationID(nctx))
+
var atUserID []string
+
conversation := &pbconversation.ConversationReq{
ConversationID: msgprocessor.GetConversationIDByMsg(msg),
ConversationType: msg.SessionType,
GroupID: msg.GroupID,
}
+
tagAll := datautil.Contain(constant.AtAllString, msg.AtUserIDList...)
if tagAll {
memberUserIDList, err := m.GroupLocalCache.GetGroupMemberIDs(ctx, msg.GroupID)
@@ -94,25 +97,35 @@ func (m *msgServer) setConversationAtInfo(nctx context.Context, msg *sdkws.MsgDa
log.ZWarn(ctx, "GetGroupMemberIDs", err)
return
}
- atUserID = stringutil.DifferenceString([]string{constant.AtAllString}, msg.AtUserIDList)
+
+ memberUserIDList = datautil.DeleteElems(memberUserIDList, msg.SendID)
+
+ atUserID = datautil.Single([]string{constant.AtAllString}, msg.AtUserIDList)
+
if len(atUserID) == 0 { // just @everyone
conversation.GroupAtType = &wrapperspb.Int32Value{Value: constant.AtAll}
} else { // @Everyone and @other people
conversation.GroupAtType = &wrapperspb.Int32Value{Value: constant.AtAllAtMe}
+
err = m.Conversation.SetConversations(ctx, atUserID, conversation)
if err != nil {
log.ZWarn(ctx, "SetConversations", err, "userID", atUserID, "conversation", conversation)
}
- memberUserIDList = stringutil.DifferenceString(atUserID, memberUserIDList)
+
+ memberUserIDList = datautil.Single(atUserID, memberUserIDList)
}
+
conversation.GroupAtType = &wrapperspb.Int32Value{Value: constant.AtAll}
+
err = m.Conversation.SetConversations(ctx, memberUserIDList, conversation)
if err != nil {
log.ZWarn(ctx, "SetConversations", err, "userID", memberUserIDList, "conversation", conversation)
}
+
return
}
conversation.GroupAtType = &wrapperspb.Int32Value{Value: constant.AtMe}
+
err := m.Conversation.SetConversations(ctx, msg.AtUserIDList, conversation)
if err != nil {
log.ZWarn(ctx, "SetConversations", err, msg.AtUserIDList, conversation)
diff --git a/pkg/common/storage/controller/conversation.go b/pkg/common/storage/controller/conversation.go
index 06a073365..f0b7d70db 100644
--- a/pkg/common/storage/controller/conversation.go
+++ b/pkg/common/storage/controller/conversation.go
@@ -16,9 +16,10 @@ package controller
import (
"context"
+ "time"
+
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database"
relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
- "time"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
"github.com/openimsdk/open-im-server/v3/pkg/msgprocessor"
@@ -194,7 +195,7 @@ func (c *conversationDatabase) SyncPeerUserPrivateConversationTx(ctx context.Con
return c.tx.Transaction(ctx, func(ctx context.Context) error {
cache := c.cache.CloneConversationCache()
for _, conversation := range conversations {
- cache = cache.DelConversationVersionUserIDs(conversation.OwnerUserID)
+ cache = cache.DelConversationVersionUserIDs(conversation.OwnerUserID, conversation.UserID)
for _, v := range [][2]string{{conversation.OwnerUserID, conversation.UserID}, {conversation.UserID, conversation.OwnerUserID}} {
ownerUserID := v[0]
userID := v[1]
diff --git a/pkg/common/storage/controller/msg_transfer.go b/pkg/common/storage/controller/msg_transfer.go
index c5dfd011f..c6013dbc1 100644
--- a/pkg/common/storage/controller/msg_transfer.go
+++ b/pkg/common/storage/controller/msg_transfer.go
@@ -2,6 +2,7 @@ package controller
import (
"context"
+ "github.com/openimsdk/protocol/constant"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
@@ -83,6 +84,9 @@ func (db *msgTransferDatabase) BatchInsertChat2DB(ctx context.Context, conversat
IOSBadgeCount: msg.OfflinePushInfo.IOSBadgeCount,
}
}
+ if msg.Status == constant.MsgStatusSending {
+ msg.Status = constant.MsgStatusSendSuccess
+ }
msgs[i] = &model.MsgDataModel{
SendID: msg.SendID,
RecvID: msg.RecvID,