|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
Template.message.helpers |
|
|
|
|
|
|
|
|
|
own: -> |
|
|
|
|
return 'own' if this.u?._id is Meteor.userId() |
|
|
|
|
return 'own' if this.u?._id is Meteor.userId() |
|
|
|
|
|
|
|
|
|
time: -> |
|
|
|
|
return moment(this.ts).format('HH:mm') |
|
|
|
|
@ -23,8 +23,8 @@ Template.message.helpers |
|
|
|
|
when 'nu' then t('User_added', { user_added: this.u.username }) |
|
|
|
|
when 'uj' then t('User_joined_channel', { user: this.u.username }) |
|
|
|
|
when 'wm' then t('Welcome', { user: this.u.username }) |
|
|
|
|
when 'rtc' then RocketChat.callbacks.run 'renderRtcMessage', this |
|
|
|
|
when 'rm' then t('Message_removed', { user: this.u.username }) |
|
|
|
|
when 'rtc' then RocketChat.callbacks.run 'renderRtcMessage', this |
|
|
|
|
else |
|
|
|
|
this.html = this.msg |
|
|
|
|
if _.trim(this.html) isnt '' |
|
|
|
|
@ -35,17 +35,14 @@ Template.message.helpers |
|
|
|
|
|
|
|
|
|
system: -> |
|
|
|
|
return 'system' if this.t in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj', 'rm'] |
|
|
|
|
|
|
|
|
|
edited: -> |
|
|
|
|
return @ets and @t not in ['s', 'p', 'f', 'r', 'au', 'ru', 'ul', 'nu', 'wm', 'uj', 'rm'] |
|
|
|
|
canEdit: -> |
|
|
|
|
return RocketChat.settings.get 'Message_AllowEditing' |
|
|
|
|
canDelete: -> |
|
|
|
|
return RocketChat.settings.get 'Message_AllowDeleting' |
|
|
|
|
showEditedStatus: -> |
|
|
|
|
return RocketChat.settings.get 'Message_ShowEditedStatus' |
|
|
|
|
showDeletedStatus: -> |
|
|
|
|
return RocketChat.settings.get 'Message_ShowDeletedStatus' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Template.message.onViewRendered = (context) -> |
|
|
|
|
view = this |
|
|
|
|
|