// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. const Utils = require('./utils.jsx'); const InviteMemberModal = require('../components/invite_member_modal.jsx'); const UserProfile = require('../components/user_profile.jsx'); const ChannelStore = require('../stores/channel_store.jsx'); const Constants = require('../utils/constants.jsx'); const TeamStore = require('../stores/team_store.jsx'); export function createChannelIntroMessage(channel, showInviteModal) { if (channel.type === 'D') { return createDMIntroMessage(channel); } else if (ChannelStore.isDefault(channel)) { return createDefaultIntroMessage(channel); } else if (channel.name === Constants.OFFTOPIC_CHANNEL) { return createOffTopicIntroMessage(channel, showInviteModal); } else if (channel.type === 'O' || channel.type === 'P') { return createStandardIntroMessage(channel, showInviteModal); } } export function createDMIntroMessage(channel) { var teammate = Utils.getDirectTeammate(channel.id); if (teammate) { var teammateName = teammate.username; if (teammate.nickname.length > 0) { teammateName = teammate.nickname; } return (
{'This is the start of your direct message history with ' + teammateName + '.'}
{'Direct messages and files shared here are not shown to people outside this area.'}
{'This is the start of your direct message history with this teammate. Direct messages and files shared here are not shown to people outside this area.'}
{'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'}
{'Welcome to ' + channel.display_name + '!'}
{'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'}
{createMessage}
{memberMessage}