mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 03:35:45 +08:00
DEV: Add chat_quoted notification type (#15968)
This is needed for the notification sent when quoting chat messages inside a post.
This commit is contained in:
parent
1ea19a4d51
commit
2d30dd439f
app
assets/javascripts/discourse-common/addon/lib
models
services
spec/requests/api/schemas/json
@ -48,6 +48,7 @@ const REPLACEMENTS = {
|
|||||||
"notification.membership_request_consolidated": "users",
|
"notification.membership_request_consolidated": "users",
|
||||||
"notification.reaction": "bell",
|
"notification.reaction": "bell",
|
||||||
"notification.votes_released": "plus",
|
"notification.votes_released": "plus",
|
||||||
|
"notification.chat_quoted": "quote-right",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function replaceIcon(source, destination) {
|
export function replaceIcon(source, destination) {
|
||||||
|
@ -109,7 +109,8 @@ class Notification < ActiveRecord::Base
|
|||||||
chat_mention: 29,
|
chat_mention: 29,
|
||||||
chat_message: 30,
|
chat_message: 30,
|
||||||
chat_invitation: 31,
|
chat_invitation: 31,
|
||||||
chat_group_mention: 32
|
chat_group_mention: 32,
|
||||||
|
chat_quoted: 33
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -429,8 +429,13 @@ class PostAlerter
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
# linked, quoted, mentioned may be suppressed if you already have a reply notification
|
# linked, quoted, mentioned, chat_quoted may be suppressed if you already have a reply notification
|
||||||
if type == Notification.types[:quoted] || type == Notification.types[:linked] || type == Notification.types[:mentioned]
|
if [
|
||||||
|
Notification.types[:quoted],
|
||||||
|
Notification.types[:linked],
|
||||||
|
Notification.types[:mentioned],
|
||||||
|
Notification.types[:chat_quoted]
|
||||||
|
].include?(type)
|
||||||
return if existing_notifications.find { |n| n.notification_type == Notification.types[:replied] }
|
return if existing_notifications.find { |n| n.notification_type == Notification.types[:replied] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -103,6 +103,9 @@
|
|||||||
},
|
},
|
||||||
"chat_group_mention": {
|
"chat_group_mention": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"chat_quoted": {
|
||||||
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user