Make GM behave as DM (#24289)
* Make GM behave as DM * Fix lint * Add desktop notification special behavior * Change notification preferences menu * Make changes to the GM channel intro * Fix tests * Fix i18n and style lint * Add system notice and update style * Fix style and fix tests * Fix tests * Handle push notifications as desktop notifications * Fix tests * Add test and default GMs to none when user level config is none * Fix test * Update only for mentions text * Add tests * Fix lint * Fix lint
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
39d6cb8008
Коммит
88d043a971
@@ -387,7 +387,9 @@ func (a *App) SendNotifications(c request.CTX, post *model.Post, team *model.Tea
|
||||
status = &model.Status{UserId: id, Status: model.StatusOffline, Manual: false, LastActivityAt: 0, ActiveChannel: ""}
|
||||
}
|
||||
|
||||
if ShouldSendPushNotification(profileMap[id], channelMemberNotifyPropsMap[id], true, status, post) {
|
||||
isExplicitlyMentioned := mentions.Mentions[id] > GMMention
|
||||
isGM := channel.Type == model.ChannelTypeGroup
|
||||
if ShouldSendPushNotification(profileMap[id], channelMemberNotifyPropsMap[id], isExplicitlyMentioned, status, post, isGM) {
|
||||
mentionType := mentions.Mentions[id]
|
||||
|
||||
replyToThreadType := ""
|
||||
@@ -428,7 +430,8 @@ func (a *App) SendNotifications(c request.CTX, post *model.Post, team *model.Tea
|
||||
status = &model.Status{UserId: id, Status: model.StatusOffline, Manual: false, LastActivityAt: 0, ActiveChannel: ""}
|
||||
}
|
||||
|
||||
if ShouldSendPushNotification(profileMap[id], channelMemberNotifyPropsMap[id], false, status, post) {
|
||||
isGM := channel.Type == model.ChannelTypeGroup
|
||||
if ShouldSendPushNotification(profileMap[id], channelMemberNotifyPropsMap[id], false, status, post, isGM) {
|
||||
a.sendPushNotification(
|
||||
notification,
|
||||
profileMap[id],
|
||||
@@ -770,6 +773,14 @@ func (a *App) getExplicitMentionsAndKeywords(c request.CTX, post *model.Post, ch
|
||||
keywords = a.getMentionKeywordsInChannel(profileMap, allowChannelMentions, channelMemberNotifyPropsMap)
|
||||
|
||||
mentions = getExplicitMentions(post, keywords, groups)
|
||||
|
||||
// Add a GM mention to all members of a GM channel
|
||||
if channel.Type == model.ChannelTypeGroup {
|
||||
for id := range channelMemberNotifyPropsMap {
|
||||
mentions.addMention(id, GMMention)
|
||||
}
|
||||
}
|
||||
|
||||
// Add an implicit mention when a user is added to a channel
|
||||
// even if the user has set 'username mentions' to false in account settings.
|
||||
if post.Type == model.PostTypeAddToChannel {
|
||||
@@ -1063,6 +1074,9 @@ const (
|
||||
// A placeholder that should never be used in practice
|
||||
NoMention MentionType = iota
|
||||
|
||||
// The post is in a GM
|
||||
GMMention
|
||||
|
||||
// The post is in a thread that the user has commented on
|
||||
ThreadMention
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user