parent
1bda97d87b
commit
d9ce4c9a62
@ -0,0 +1 @@ |
||||
import '/imports/startup/client'; |
@ -0,0 +1 @@ |
||||
import './readReceipts'; |
@ -0,0 +1,8 @@ |
||||
<template name="readReceipts"> |
||||
{{#each receipts}} |
||||
<div class="message background-transparent-dark-hover"> |
||||
<div class="user color-primary-font-color">{{user}}</div> |
||||
<span class="time color-info-font-color" title="{{dateTime}}">{{time}}</span> |
||||
</div> |
||||
{{/each}} |
||||
</template> |
@ -0,0 +1,29 @@ |
||||
import { ReactiveVar } from 'meteor/reactive-var'; |
||||
import moment from 'moment'; |
||||
|
||||
import './readReceipts.html'; |
||||
|
||||
Template.readReceipts.helpers({ |
||||
receipts() { |
||||
return Template.instance().readReceipts.get(); |
||||
}, |
||||
user() { |
||||
return this.user.name || this.user.username; |
||||
}, |
||||
time() { |
||||
return moment(this.ts).format('L LTS'); |
||||
} |
||||
}); |
||||
|
||||
Template.readReceipts.onCreated(function readReceiptsOnCreated() { |
||||
this.loading = new ReactiveVar(false); |
||||
this.readReceipts = new ReactiveVar([]); |
||||
}); |
||||
|
||||
Template.readReceipts.onRendered(function readReceiptsOnRendered() { |
||||
this.loading.set(true); |
||||
Meteor.call('getReadReceipts', { messageId: this.data.messageId }, (error, result) => { |
||||
this.loading.set(false); |
||||
this.readReceipts.set(result); |
||||
}); |
||||
}); |
@ -0,0 +1,11 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { ReadReceipt } from '../../lib/ReadReceipt'; |
||||
|
||||
Meteor.methods({ |
||||
getReadReceipts({ messageId }) { |
||||
const message = RocketChat.models.Messages.findOneById(messageId); |
||||
|
||||
return ReadReceipt.getReceipts(message); |
||||
} |
||||
}); |
@ -1,2 +1,4 @@ |
||||
import './dbIndexes'; |
||||
import './settings'; |
||||
|
||||
import './api/methods/getReadReceipts'; |
||||
|
@ -0,0 +1 @@ |
||||
import '../../message-read-receipt/client'; |
Loading…
Reference in new issue