Skip to content
Snippets Groups Projects
Unverified Commit db267106 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

Change categories to constants

parent 8f975bcb
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ promise@0.10.0
raix:eventemitter@0.1.3
raix:eventstate@0.0.4
raix:handlebar-helpers@0.2.5
raix:push@3.0.3-rc.7
raix:push@3.2.0
raix:ui-dropped-event@0.0.7
random@1.0.10
rate-limit@1.0.8
......
......@@ -3,6 +3,9 @@ import _ from 'underscore';
import s from 'underscore.string';
import moment from 'moment';
const CATEGORY_MESSAGE = 'MESSAGE';
const CATEGORY_MESSAGE_NOREPLY = 'MESSAGE_NOREPLY';
/**
* Replaces @username with full name
*
......@@ -141,7 +144,7 @@ const sendPushNotifications = (userIdsToPushNotify = [], message, room, push_roo
usersTo: {
userId: userIdToNotify
},
category: canSendMessageToRoom(room, pushUsernames[userIdToNotify]) ? 'MESSAGE' : 'MESSAGE_NOREPLY'
category: canSendMessageToRoom(room, pushUsernames[userIdToNotify]) ? CATEGORY_MESSAGE : CATEGORY_MESSAGE_NOREPLY
});
});
}
......@@ -301,7 +304,7 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room, userId) {
usersTo: {
userId: userOfMention._id
},
category: canSendMessageToRoom(room, userOfMention.username) ? 'MESSAGE' : 'MESSAGE_NOREPLY'
category: canSendMessageToRoom(room, userOfMention.username) ? CATEGORY_MESSAGE : CATEGORY_MESSAGE_NOREPLY
});
return message;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment