Skip to content
Snippets Groups Projects
Commit 7c628467 authored by Lucas Vanhalst's avatar Lucas Vanhalst
Browse files

add timestamp to quoted messages

parent c14f2d48
No related branches found
No related tags found
No related merge requests found
......@@ -37,3 +37,6 @@ Template.messageAttachment.helpers
return this.collapsed
else
return Meteor.user()?.settings?.preferences?.collapseMediaByDefault is true
time: ->
return moment(@ts).format(RocketChat.settings.get('Message_TimeFormat'))
......@@ -12,6 +12,9 @@
<img src="{{fixCordova author_icon}}">
{{/if}}
<a href="{{fixCordova author_link}}" target="_blank">{{author_name}}</a>
{{#if ts}}
<span class="time">{{time}}</span>
{{/if}}
</div>
{{else}}
<div class="attachment-author">
......@@ -19,6 +22,9 @@
<img src="{{fixCordova author_icon}}">
{{/if}}
{{author_name}}
{{#if ts}}
<span class="time">{{time}}</span>
{{/if}}
</div>
{{/if}}
{{/if}}
......
......@@ -30,6 +30,11 @@
margin-right: 2px;
margin-bottom: -2px;
}
.time {
font-weight: normal;
font-size: .8em;
color: #aaa;
}
}
.attachment-title {
......
......@@ -26,7 +26,8 @@ Meteor.methods
attachments: [
"text" : message.msg
"author_name" : message.u.username,
"author_icon" : getAvatarUrlFromUsername(message.u.username)
"author_icon" : getAvatarUrlFromUsername(message.u.username),
"ts" : new Date()
]
unpinMessage: (message) ->
......
......@@ -17,7 +17,8 @@ RocketChat.callbacks.add('beforeSaveMessage', (msg) => {
msg.attachments.push({
'text' : jumpToMessage.msg,
'author_name' : jumpToMessage.u.username,
'author_icon' : getAvatarUrlFromUsername(jumpToMessage.u.username)
'author_icon' : getAvatarUrlFromUsername(jumpToMessage.u.username),
'ts': new Date()
});
item.ignoreParse = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment