FEATURE: suggested messages for messages

FEATURE: clicking envelope takes you to inbox

Suggested messages works somewhat like suggested topics.

- New show up first (in either group inbox or inbox)
- Then unread (in either group inbox or inbox)
- Finally "related" which are messages with same participants as the current pm.
This commit is contained in:
Sam Saffron
2016-02-03 18:50:05 +11:00
parent 133fcef72c
commit bc75010b20
14 changed files with 296 additions and 27 deletions

View File

@ -38,7 +38,14 @@ module Helpers
args[:topic_id] = args[:topic].id if args[:topic]
user = args.delete(:user) || Fabricate(:user)
args[:category] = args[:category].name if args[:category].is_a?(Category)
PostCreator.create(user, args)
creator = PostCreator.new(user, args)
post = creator.create
if creator.errors.present?
raise StandardError.new(creator.errors.full_messages.join(" "))
end
post
end
def generate_username(length=10)