Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REGRESSION] Fix variable name references in message template #14184

Merged
merged 2 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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