mattermost-mobile/app/utils/notify_props.js
2018-06-19 19:14:50 -04:00

28 lines
669 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export function getNotificationProps(user) {
if (user && user.notify_props) {
return user.notify_props;
}
const props = {
channel: 'true',
comments: 'any',
desktop: 'all',
desktop_sound: 'true',
email: 'true',
mention_keys: user ? `${user.username},@${user.username}` : '',
push: 'mention',
push_status: 'online',
};
if (!user || !user.first_name) {
props.first_name = 'false';
} else {
props.first_name = 'true';
}
return props;
}