2022-11-02 09:41:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-11-02 10:53:36 -04:00
|
|
|
class DirectMessageChannel < ChatChannel
|
|
|
|
alias_attribute :direct_message, :chatable
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2022-11-02 10:53:36 -04:00
|
|
|
def direct_message_channel?
|
|
|
|
true
|
2022-11-02 09:41:30 -04:00
|
|
|
end
|
|
|
|
|
2022-11-02 10:53:36 -04:00
|
|
|
def allowed_user_ids
|
|
|
|
direct_message.user_ids
|
2022-11-02 09:41:30 -04:00
|
|
|
end
|
|
|
|
|
2022-11-02 10:53:36 -04:00
|
|
|
def read_restricted?
|
|
|
|
true
|
|
|
|
end
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2022-11-02 10:53:36 -04:00
|
|
|
def title(user)
|
|
|
|
direct_message.chat_channel_title_for_user(self, user)
|
2022-11-02 09:41:30 -04:00
|
|
|
end
|
2022-11-08 19:28:31 -05:00
|
|
|
|
|
|
|
def ensure_slug_ok
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def generate_auto_slug
|
|
|
|
self.slug = nil
|
|
|
|
end
|
2022-11-02 09:41:30 -04:00
|
|
|
end
|