Fix missing profile messages on notification dashboards (#28297)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6d51307ddf
Коммит
1e8ef05338
@@ -334,26 +334,34 @@ func (o *Channel) IsShared() bool {
|
||||
}
|
||||
|
||||
func (o *Channel) GetOtherUserIdForDM(userId string) string {
|
||||
if o.Type != ChannelTypeDirect {
|
||||
user1, user2 := o.GetBothUsersForDM()
|
||||
|
||||
if user2 == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
if user1 == userId {
|
||||
return user2
|
||||
}
|
||||
|
||||
return user1
|
||||
}
|
||||
|
||||
func (o *Channel) GetBothUsersForDM() (string, string) {
|
||||
if o.Type != ChannelTypeDirect {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
userIds := strings.Split(o.Name, "__")
|
||||
if len(userIds) != 2 {
|
||||
return ""
|
||||
return "", ""
|
||||
}
|
||||
|
||||
var otherUserId string
|
||||
|
||||
if userIds[0] != userIds[1] {
|
||||
if userIds[0] == userId {
|
||||
otherUserId = userIds[1]
|
||||
} else {
|
||||
otherUserId = userIds[0]
|
||||
}
|
||||
if userIds[0] == userIds[1] {
|
||||
return userIds[0], ""
|
||||
}
|
||||
|
||||
return otherUserId
|
||||
return userIds[0], userIds[1]
|
||||
}
|
||||
|
||||
func (o *Channel) Sanitize() Channel {
|
||||
|
||||
Ссылка в новой задаче
Block a user