Skip to content

Commit

Permalink
[FIX] more message actions to threads context(follow, unfollow, copy,…
Browse files Browse the repository at this point in the history
… delete) (#14387)

* added more message actions to threads context

* more actions
  • Loading branch information
ggazzo authored and rodrigok committed May 9, 2019
1 parent 3d64d98 commit 41c9385
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app/autotranslate/client/lib/actionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Meteor.startup(function() {
context: [
'message',
'message-mobile',
'threads',
],
action() {
const { msg: message } = messageArgs(this);
Expand All @@ -41,6 +42,7 @@ Meteor.startup(function() {
context: [
'message',
'message-mobile',
'threads',
],
action() {
const { msg: message } = messageArgs(this);
Expand Down
8 changes: 4 additions & 4 deletions app/message-star/client/actionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Meteor.startup(function() {
id: 'star-message',
icon: 'star',
label: 'Star',
context: ['starred', 'message', 'message-mobile'],
context: ['starred', 'message', 'message-mobile', 'threads'],
action() {
const { msg: message } = messageArgs(this);
message.starred = Meteor.userId();
Expand All @@ -37,7 +37,7 @@ Meteor.startup(function() {
id: 'unstar-message',
icon: 'star',
label: 'Unstar_Message',
context: ['starred', 'message', 'message-mobile'],
context: ['starred', 'message', 'message-mobile', 'threads'],
action() {
const { msg: message } = messageArgs(this);
message.starred = false;
Expand All @@ -62,7 +62,7 @@ Meteor.startup(function() {
id: 'jump-to-star-message',
icon: 'jump',
label: 'Jump_to_message',
context: ['starred'],
context: ['starred', 'threads'],
action() {
const { msg: message } = messageArgs(this);
if (window.matchMedia('(max-width: 500px)').matches) {
Expand All @@ -85,7 +85,7 @@ Meteor.startup(function() {
icon: 'permalink',
label: 'Get_link',
classes: 'clipboard',
context: ['starred'],
context: ['starred', 'threads'],
async action(event) {
const { msg: message } = messageArgs(this);
$(event.currentTarget).attr('data-clipboard-text', await MessageAction.getPermaLink(message._id));
Expand Down
1 change: 1 addition & 0 deletions app/reactions/client/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Meteor.startup(function() {
context: [
'message',
'message-mobile',
'threads',
],
action(event) {
event.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion app/threads/client/messageAction/follow.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Meteor.startup(function() {
id: 'follow-message',
icon: 'bell',
label: 'Follow_message',
context: ['threads'],
context: ['message', 'message-mobile', 'threads'],
async action() {
const { msg } = messageArgs(this);
call('followMessage', { mid: msg._id });
Expand Down
2 changes: 1 addition & 1 deletion app/threads/client/messageAction/unfollow.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Meteor.startup(function() {
id: 'unfollow-message',
icon: 'bell-off',
label: 'Unfollow_message',
context: ['threads'],
context: ['message', 'message-mobile', 'threads'],
async action() {
const { msg } = messageArgs(this);
call('unfollowMessage', { mid: msg._id });
Expand Down
14 changes: 7 additions & 7 deletions app/ui-utils/client/lib/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Meteor.startup(async function() {
id: 'reply-directly',
icon: 'reply-directly',
label: 'Reply_in_direct_message',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
action() {
const { msg } = messageArgs(this);
roomTypes.openRouteLink('d', { name: msg.u.username }, {
Expand All @@ -174,7 +174,7 @@ Meteor.startup(async function() {
id: 'quote-message',
icon: 'quote',
label: 'Quote',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
action() {
const { msg: message } = messageArgs(this);
const { input } = chatMessages[message.rid];
Expand Down Expand Up @@ -206,7 +206,7 @@ Meteor.startup(async function() {
icon: 'permalink',
label: 'Get_link',
classes: 'clipboard',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
async action(event) {
const { msg: message } = messageArgs(this);
const permalink = await MessageAction.getPermaLink(message._id);
Expand All @@ -229,7 +229,7 @@ Meteor.startup(async function() {
icon: 'copy',
label: 'Copy',
classes: 'clipboard',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
action(event) {
const { msg: message } = messageArgs(this);
$(event.currentTarget).attr('data-clipboard-text', message);
Expand All @@ -250,7 +250,7 @@ Meteor.startup(async function() {
id: 'edit-message',
icon: 'edit',
label: 'Edit',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
action() {
const { msg } = messageArgs(this);
chatMessages[Session.get('openedRoom')].edit(document.getElementById(msg._id));
Expand Down Expand Up @@ -290,7 +290,7 @@ Meteor.startup(async function() {
id: 'delete-message',
icon: 'trash',
label: 'Delete',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
color: 'alert',
action() {
const { msg: message } = messageArgs(this);
Expand All @@ -315,7 +315,7 @@ Meteor.startup(async function() {
id: 'report-message',
icon: 'report',
label: 'Report',
context: ['message', 'message-mobile'],
context: ['message', 'message-mobile', 'threads'],
color: 'alert',
action() {
const { msg: message } = messageArgs(this);
Expand Down

0 comments on commit 41c9385

Please sign in to comment.