Skip to content

Commit

Permalink
show persons that read the chatmessage
Browse files Browse the repository at this point in the history
This could be improved imo:
- We limit to 3 users without any indication that there are more people who have
  read it.
- Add a way to see who read the message on mobile (tap to show more info, like
  Messenger has?)
  • Loading branch information
lieuwex committed Dec 25, 2015
1 parent 2e8d66a commit 8fb0609
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/chat/client/chatMessages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ Template.messageRow.events

Template.messageRow.rendered = ->
$node = $ @firstNode
$parent = $ @firstNode.parentNode

if Session.equals 'deviceType', 'desktop'
# TODO: fix this when opening multiple times.
$node.find('[data-toggle="tooltip"]').tooltip
container: 'body'
placement: if $node.hasClass('own') then 'right' else 'left'
placement: if $node.hasClass('own') then 'auto right' else 'auto left'
9 changes: 8 additions & 1 deletion packages/chat/client/chatMessages.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@
</div>
{{/if}}
<div class="time">{{__time}}</div>
<div class="readBy">
{{#each __readBy}}
<a href="{{pathFor 'personView' id=_id}}">
<img src="{{picture this 100}}" width="15" height="15" title="Gelezen door {{profile.firstName}}" data-toggle="tooltip"/>
</a>
{{/each}}
</div>
</aside>
{{#with __sender}}
<a href="{{pathFor 'personView' _id=_id}}">
<a href="{{pathFor 'personView' id=_id}}">
<img class="senderImage" src="{{picture this 100}}" width="25" height="25" title="{{profile.firstName}} {{profile.lastName}}" data-toggle="tooltip"/>
</a>
{{/with}}
Expand Down
9 changes: 9 additions & 0 deletions packages/chat/client/fullscreenChatWindow.styl
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,22 @@ div#fullscreenChatWindow
left: initial
right: -170px

align(vertical)
font-size: 15px
text-align: left

.edited
float: left
margin-left: 0
margin-right: 5px

.readBy
absolute: right -20px top 50%
transform: translateY(-50%)

img
pointer-events: all

img.senderImage
float: right

Expand Down
8 changes: 8 additions & 0 deletions packages/chat/lib/middlewares.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,13 @@ ChatMiddlewares.attach 'add hidden fields', 'client', (cm) ->
__time: Helpers.formatDate cm.time
__changedOn: Helpers.formatDate cm.changedOn
__pending: if cm.pending then 'pending' else ''
__readBy: ->
Meteor.users.find {
_id:
$in: cm.readBy
$nin: [ Meteor.userId(), cm.creatorId ]
}, {
limit: 3
}

@ChatMiddlewares = ChatMiddlewares

0 comments on commit 8fb0609

Please sign in to comment.