Skip to content

Commit

Permalink
REGRESSION: Fix variable name references in message template (#14184)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-gubert authored and ggazzo committed Apr 18, 2019
1 parent 535324e commit ea58137
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 10 additions & 10 deletions app/ui-message/client/message.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template name="message">
<li id="{{templatePrefix}}{{msg._id}}" data-id="{{msg._id}}" data-context={{actionContext}} class="message background-transparent-dark-hover {{ignoredClass}} {{sequentialClass}} {{system}} {{t}} {{own}} {{isTemp}} {{chatops}} {{collapsed}} {{customClass}}" data-username="{{msg.u.username}}" data-tmid="{{msg.tmid}}" data-groupable="{{isGroupable}}" data-date="{{date}}" data-timestamp="{{timestamp}}">
{{#if avatar}}
{{#if msg.avatar}}
{{#if avatarFromUsername}}
<button class="thumb user-card-message" data-username="{{msg.u.username}}" tabindex="1">{{> avatar username=avatarFromUsername}}</button>
{{else}}
Expand All @@ -11,10 +11,10 @@
</button>
{{/if}}
{{else}}
{{#if emoji}}
{{#if msg.emoji}}
<button class="thumb user-card-message" data-username="{{msg.u.username}}" tabindex="1">
<div class="avatar">
{{> renderEmoji emoji}}
{{> renderEmoji msg.emoji}}
</div>
</button>
{{else}}
Expand All @@ -32,7 +32,7 @@
<time class="time" title='{{date}} {{time}}' datetime='{{date}} {{time}}'>{{time}}</time>
{{#if showTranslated}}
<span class="translated">
<i class="icon-language {{#if autoTranslateFetching}}loading{{/if}}" aria-label="{{_ "Translated"}}"></i>
<i class="icon-language {{#if msg.autoTranslateFetching}}loading{{/if}}" aria-label="{{_ "Translated"}}"></i>
</span>
{{/if}}
{{#if sentByEmail}}
Expand All @@ -46,7 +46,7 @@
</span>
{{/if}}
{{#if msg.alert}}<div aria-label="{{_ msg.alert }}" class="rc-tooltip message-unread"></div> {{/if}}
{{#if private}}
{{#if msg.private}}
<span class="private">{{_ "Only_you_can_see_this_message"}}</span>
{{/if}}
{{#if isThreadReply}}
Expand Down Expand Up @@ -116,9 +116,9 @@
{{/if}}

{{#with readReceipt}}
<div class="read-receipt {{readByEveryone}}">
{{> icon icon="check" }}
</div>
<div class="read-receipt {{readByEveryone}}">
{{> icon icon="check" }}
</div>
{{/with}}
{{#unless system}}
<div class="message-actions">
Expand Down Expand Up @@ -153,14 +153,14 @@
{{/each}}
</ul>
{{/unless}}
{{# if broadcast}}
{{#if broadcast}}
{{#with msg.u}}
<button type="button" class="js-reply-broadcast rc-button rc-button--primary rc-button--small rc-button--outline" name="button">
{{> icon icon="reply"}} {{_'Reply'}}
</button>
{{/with}}
{{/if}}
{{# unless hideReactions}}
{{#unless hideReactions}}
<ul class="reactions">
{{#each reaction in reactions}}
<li data-emoji="{{reaction.emoji}}" {{markUserReaction reaction}}>
Expand Down
3 changes: 1 addition & 2 deletions app/ui-utils/client/lib/RoomManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ Meteor.startup(() => {
Tracker.autorun(function() {
if (Meteor.userId()) {
return Notifications.onUser('message', function(msg) {
msg.u =
{ username: 'rocket.cat' };
msg.u = msg.u || { username: 'rocket.cat' };
msg.private = true;

return ChatMessage.upsert({ _id: msg._id }, msg);
Expand Down

0 comments on commit ea58137

Please sign in to comment.