Skip to content

Commit

Permalink
Merge pull request RocketChat#226 from shubhsherl/fix_quote
Browse files Browse the repository at this point in the history
Fix quote message redirection
  • Loading branch information
ear-dev committed Apr 14, 2020
2 parents aed6b8d + 9b4fd0c commit e816159
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/message-attachments/client/messageAttachment.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<a href="{{author_link}}" target="_blank" rel="noopener noreferrer">{{author_name}}</a>
{{#if ts}}
{{#if message_link}}
<span class="time-link">
<a href="{{message_link}}" rel="noopener noreferrer">{{time}}</a>
</span>
<button type="button" class="time">
<span class="time-link">{{time}}</span>
</button>
{{else}}
{{#unless time}}
<span class="time">
Expand All @@ -38,9 +38,9 @@
{{author_name}}
{{#if ts}}
{{#if message_link}}
<span class="time-link">
<a href="{{message_link}}" rel="noopener noreferrer">{{time}}</a>
</span>
<button type="button" class="time">
<span class="time-link">{{time}}</span>
</button>
{{else}}
{{#unless time}}
<span class="time">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ html.rtl .attachment {
margin-bottom: -2px;
}

& .time,
& .time {
font-size: 0.8em;
font-weight: normal;
}

& .time-link {
color: #1d74f5;

font-size: 0.8em;
font-weight: normal;
}
Expand Down
8 changes: 5 additions & 3 deletions app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,11 +878,13 @@ Template.room.events({

popover.open(config);
},
'click .time a'(e) {
'click .time-link'(e) {
e.preventDefault();
const { msg } = messageArgs(this);
const repliedMessageId = msg.attachments[0].message_link.split('?msg=')[1];
FlowRouter.go(FlowRouter.current().context.pathname, null, { msg: repliedMessageId, hash: Random.id() });
const link = msg.attachments ? msg.attachments[0].message_link : this.message_link;
const repliedMessageId = link.split('?msg=')[1];
const { pathname } = new URL(link);
FlowRouter.go(pathname, null, { msg: repliedMessageId, hash: Random.id() });
},
'click .mention-link'(e, instance) {
if (!Meteor.userId()) {
Expand Down

0 comments on commit e816159

Please sign in to comment.