DEV: Add messages tab to the new user menu (#17850)

Some of the changes in this PR are extracted from https://github.com/discourse/discourse/pull/17379.

Similar to the bookmarks tab in the new user menu, the messages tab also displays a mix of notifications and messages. When there are unread message notifications, the tab displays all of these notifications at the top and fills the remaining space in the menu with a list of the user's messages. The bubble/badge count on the messages tab indicates how many unread message notifications there are.
This commit is contained in:
Osama Sayegh
2022-08-10 08:25:39 +03:00
committed by GitHub
parent 23520b88c2
commit 473695ee4d
20 changed files with 811 additions and 90 deletions

View File

@ -2,7 +2,7 @@
class TopicQuery
module PrivateMessageLists
def list_private_messages(user)
def list_private_messages(user, &blk)
list = private_messages_for(user, :user)
list = not_archived(list, user)
@ -14,7 +14,7 @@ class TopicQuery
)
SQL
create_list(:private_messages, {}, list)
create_list(:private_messages, {}, list, &blk)
end
def list_private_messages_archive(user)