forked from AkkomaGang/akkoma
1 line
No EOL
33 KiB
Text
1 line
No EOL
33 KiB
Text
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/column_settings_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/conversation_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/containers/conversations_list_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/direct_timeline/index.js"],"names":["messages","defineMessages","filter_regex","settings","ColumnSettings","injectIntl","render","this","props","onChange","intl","className","id","defaultMessage","settingPath","label","formatMessage","React","PureComponent","connect","state","getIn","dispatch","path","checked","changeSetting","more","open","reply","markAsRead","delete","muteConversation","unmuteConversation","Conversation","isExpanded","undefined","e","destination","router","context","lastStatus","unread","markRead","button","ctrlKey","altKey","metaKey","get","history","location","mastodonBackSteps","push","preventDefault","target","src","getAttribute","onMoveUp","conversationId","onMoveDown","onMute","setExpansion","value","setState","c","namesNode","_updateEmojis","node","autoPlayGif","emojis","querySelectorAll","i","length","emoji","classList","contains","add","addEventListener","handleEmojiMouseEnter","handleEmojiMouseLeave","componentDidMount","componentDidUpdate","accounts","menu","text","action","handleClick","handleConversationMute","handleMarkAsRead","handleDelete","names","map","a","to","href","title","dangerouslySetInnerHTML","__html","reduce","prev","cur","handlers","handleReply","moveUp","handleHotkeyMoveUp","moveDown","handleHotkeyMoveDown","toggleHidden","handleShowMore","media","size","compact","classNames","tabIndex","timestamp","ref","setNamesRef","values","status","parseClick","expanded","onExpandedToggle","collapsable","icon","onClick","items","direction","ImmutablePureComponent","PropTypes","object","string","isRequired","ImmutablePropTypes","list","bool","func","replyConfirm","replyMessage","getStatus","makeGetStatus","conversation","find","x","lastStatusId","accountId","markConversationRead","_","getState","trim","openModal","message","confirm","onConfirm","replyCompose","deleteConversation","unmuteStatus","muteStatus","onToggleHidden","revealStatus","hideStatus","ConversationsList","conversations","findIndex","elementIndex","getCurrentIndex","_selectChild","last","onLoadMore","leading","index","align_top","container","element","querySelector","scrollTop","offsetTop","scrollIntoView","clientHeight","offsetHeight","focus","other","handleLoadOlder","scrollKey","setRef","item","handleMoveUp","handleMoveDown","hasMore","isLoading","maxId","expandConversations","DirectTimeline","hasUnread","conversationsMode","columnId","removeColumn","addColumn","dir","moveColumn","column","expandDirectTimeline","mountConversations","disconnect","connectDirectStream","prevProps","componentWillUnmount","unmountConversations","contents","multiColumn","pinned","trackScroll","timelineId","handleLoadMore","emptyMessage","handleLoadMoreTimeline","bindToDocument","active","onPin","handlePin","onMove","handleMove","handleHeaderClick","handleConversationsClick","handleTimelineClick"],"mappings":"yOAMMA,EAAWC,YAAe,CAC9BC,aAAa,CAAD,2FACZC,SAAS,CAAD,uDAIJC,EADUC,Y,oGASdC,OAAA,WAAW,IAAD,EAC6BC,KAAKC,MAAlCL,EADA,EACAA,SAAUM,EADV,EACUA,SAAUC,EADpB,EACoBA,KAE5B,OACE,4BACE,oBAAMC,UAAU,iCAAhB,EAA2C,YAAC,IAAD,CAAkBC,GAAG,gCAAgCC,eAAe,cAE/G,mBAAKF,UAAU,6BAAf,EACE,YAAC,IAAD,CAAaR,SAAUA,EAAUW,YAAa,CAAC,QAAS,QAASL,SAAUA,EAAUM,MAAOL,EAAKM,cAAchB,EAASE,mB,GAhBrGe,IAAMC,iB,UCIpBC,qBAZS,SAAAC,GAAK,MAAK,CA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AAa,O,EAwBtBnM,OAAA,WAAW,IAILwM,EAJI,EAC8DvM,KAAKC,MAAnEE,EADA,EACAA,KAAMqL,EADN,EACMA,UAAWE,EADjB,EACiBA,SAAUc,EAD3B,EAC2BA,YAAaf,EADxC,EACwCA,kBAC1CgB,IAAWf,EAyBjB,OArBEa,EADEd,EAEA,YAAC,GAAD,CACEiB,aAAcD,EACd3B,UAAS,mBAAqBY,EAC9BiB,WAAW,SACX5C,WAAY/J,KAAK4M,eACjBC,aAAc,YAAC,IAAD,CAAkBxM,GAAG,sBAAsBC,eAAe,kGAK1E,YAAC,IAAD,CACEoM,aAAcD,EACd3B,UAAS,mBAAqBY,EAC9BiB,WAAW,SACX5C,WAAY/J,KAAK8M,uBACjBD,aAAc,YAAC,IAAD,CAAkBxM,GAAG,sBAAsBC,eAAe,kGAM5E,kBAAC,IAAD,CAAQyM,gBAAiBP,EAAa7F,IAAK3G,KAAK+K,OAAQvK,MAAOL,EAAKM,cAAchB,GAAS8F,QACzF,YAAC,IAAD,CACE4B,KAAK,WACL6F,OAAQxB,EACRjG,MAAOpF,EAAKM,cAAchB,GAAS8F,OACnC0H,MAAOjN,KAAKkN,UACZC,OAAQnN,KAAKoN,WACbhG,QAASpH,KAAKqN,kBACdZ,OAAQA,EACRD,YAAaA,QARf,EAUE,YAAC,EAAD,KAGF,mBAAKpM,UAAU,iCAAf,EACE,sBACEA,UAAWqL,EAAoB,SAAW,GAC1CrE,QAASpH,KAAKsN,+BAFhB,EAIE,YAAC,IAAD,CACEjN,GAAG,4BACHC,eAAe,mBAGnB,sBACEF,UAAWqL,EAAoB,GAAK,SACpCrE,QAASpH,KAAKuN,0BAFhB,EAIE,YAAC,IAAD,CACElN,GAAG,uBACHC,eAAe,eAKpBiM,I,GAlJoB7L,IAAMC,iB","file":"flavours/glitch/async/direct_timeline.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport SettingText from '../../../components/setting_text';\n\nconst messages = defineMessages({\n filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },\n settings: { id: 'home.settings', defaultMessage: 'Column settings' },\n});\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n render () {\n const { settings, onChange, intl } = this.props;\n\n return (\n <div>\n <span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span>\n\n <div className='column-settings__row'>\n <SettingText settings={settings} settingPath={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} />\n </div>\n </div>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\n\nconst mapStateToProps = state => ({\n settings: state.getIn(['settings', 'direct']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n\n onChange (path, checked) {\n dispatch(changeSetting(['direct', ...path], checked));\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport StatusContent from 'flavours/glitch/components/status_content';\nimport AttachmentList from 'flavours/glitch/components/attachment_list';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport AvatarComposite from 'flavours/glitch/components/avatar_composite';\nimport Permalink from 'flavours/glitch/components/permalink';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport RelativeTimestamp from 'flavours/glitch/components/relative_timestamp';\nimport { HotKeys } from 'react-hotkeys';\nimport { autoPlayGif } from 'flavours/glitch/util/initial_state';\nimport classNames from 'classnames';\n\nconst messages = defineMessages({\n more: { id: 'status.more', defaultMessage: 'More' },\n open: { id: 'conversation.open', defaultMessage: 'View conversation' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n markAsRead: { id: 'conversation.mark_as_read', defaultMessage: 'Mark as read' },\n delete: { id: 'conversation.delete', defaultMessage: 'Delete conversation' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n});\n\nexport default @injectIntl\nclass Conversation extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n conversationId: PropTypes.string.isRequired,\n accounts: ImmutablePropTypes.list.isRequired,\n lastStatus: ImmutablePropTypes.map,\n unread:PropTypes.bool.isRequired,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n markRead: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n isExpanded: undefined,\n };\n\n parseClick = (e, destination) => {\n const { router } = this.context;\n const { lastStatus, unread, markRead } = this.props;\n if (!router) return;\n\n if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {\n if (destination === undefined) {\n if (unread) {\n markRead();\n }\n destination = `/statuses/${lastStatus.get('id')}`;\n }\n let state = {...router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n router.history.push(destination, state);\n e.preventDefault();\n }\n }\n\n _updateEmojis () {\n const node = this.namesNode;\n\n if (!node || autoPlayGif) {\n return;\n }\n\n const emojis = node.querySelectorAll('.custom-emoji');\n\n for (var i = 0; i < emojis.length; i++) {\n let emoji = emojis[i];\n if (emoji.classList.contains('status-emoji')) {\n continue;\n }\n emoji.classList.add('status-emoji');\n\n emoji.addEventListener('mouseenter', this.handleEmojiMouseEnter, false);\n emoji.addEventListener('mouseleave', this.handleEmojiMouseLeave, false);\n }\n }\n\n componentDidMount () {\n this._updateEmojis();\n }\n\n componentDidUpdate () {\n this._updateEmojis();\n }\n\n handleEmojiMouseEnter = ({ target }) => {\n target.src = target.getAttribute('data-original');\n }\n\n handleEmojiMouseLeave = ({ target }) => {\n target.src = target.getAttribute('data-static');\n }\n\n handleClick = () => {\n if (!this.context.router) {\n return;\n }\n\n const { lastStatus, unread, markRead } = this.props;\n\n if (unread) {\n markRead();\n }\n\n this.context.router.history.push(`/statuses/${lastStatus.get('id')}`);\n }\n\n handleMarkAsRead = () => {\n this.props.markRead();\n }\n\n handleReply = () => {\n this.props.reply(this.props.lastStatus, this.context.router.history);\n }\n\n handleDelete = () => {\n this.props.delete();\n }\n\n handleHotkeyMoveUp = () => {\n this.props.onMoveUp(this.props.conversationId);\n }\n\n handleHotkeyMoveDown = () => {\n this.props.onMoveDown(this.props.conversationId);\n }\n\n handleConversationMute = () => {\n this.props.onMute(this.props.lastStatus);\n }\n\n handleShowMore = () => {\n if (this.props.lastStatus.get('spoiler_text')) {\n this.setExpansion(!this.state.isExpanded);\n }\n };\n\n setExpansion = value => {\n this.setState({ isExpanded: value });\n }\n\n setNamesRef = (c) => {\n this.namesNode = c;\n }\n\n render () {\n const { accounts, lastStatus, unread, intl } = this.props;\n const { isExpanded } = this.state;\n\n if (lastStatus === null) {\n return null;\n }\n\n const menu = [\n { text: intl.formatMessage(messages.open), action: this.handleClick },\n null,\n ];\n\n menu.push({ text: intl.formatMessage(lastStatus.get('muted') ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMute });\n\n if (unread) {\n menu.push({ text: intl.formatMessage(messages.markAsRead), action: this.handleMarkAsRead });\n menu.push(null);\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDelete });\n\n const names = accounts.map(a => <Permalink to={`/accounts/${a.get('id')}`} href={a.get('url')} key={a.get('id')} title={a.get('acct')}><bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: a.get('display_name_html') }} /></bdi></Permalink>).reduce((prev, cur) => [prev, ', ', cur]);\n\n const handlers = {\n reply: this.handleReply,\n open: this.handleClick,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleHidden: this.handleShowMore,\n };\n\n let media = null;\n if (lastStatus.get('media_attachments').size > 0) {\n media = <AttachmentList compact media={lastStatus.get('media_attachments')} />;\n }\n\n return (\n <HotKeys handlers={handlers}>\n <div className={classNames('conversation focusable muted', { 'conversation--unread': unread })} tabIndex='0'>\n <div className='conversation__avatar'>\n <AvatarComposite accounts={accounts} size={48} />\n </div>\n\n <div className='conversation__content'>\n <div className='conversation__content__info'>\n <div className='conversation__content__relative-time'>\n {unread && <span className='conversation__unread' />} <RelativeTimestamp timestamp={lastStatus.get('created_at')} />\n </div>\n\n <div className='conversation__content__names' ref={this.setNamesRef}>\n <FormattedMessage id='conversation.with' defaultMessage='With {names}' values={{ names: <span>{names}</span> }} />\n </div>\n </div>\n\n <StatusContent\n status={lastStatus}\n parseClick={this.parseClick}\n expanded={isExpanded}\n onExpandedToggle={this.handleShowMore}\n collapsable\n media={media}\n />\n\n <div className='status__action-bar'>\n <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.reply)} icon='reply' onClick={this.handleReply} />\n\n <div className='status__action-bar-dropdown'>\n <DropdownMenuContainer status={lastStatus} items={menu} icon='ellipsis-h' size={18} direction='right' title={intl.formatMessage(messages.more)} />\n </div>\n </div>\n </div>\n </div>\n </HotKeys>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport Conversation from '../components/conversation';\nimport { markConversationRead, deleteConversation } from 'flavours/glitch/actions/conversations';\nimport { makeGetStatus } from 'flavours/glitch/selectors';\nimport { replyCompose } from 'flavours/glitch/actions/compose';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { muteStatus, unmuteStatus, hideStatus, revealStatus } from 'flavours/glitch/actions/statuses';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n});\n\nconst mapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n return (state, { conversationId }) => {\n const conversation = state.getIn(['conversations', 'items']).find(x => x.get('id') === conversationId);\n const lastStatusId = conversation.get('last_status', null);\n\n return {\n accounts: conversation.get('accounts').map(accountId => state.getIn(['accounts', accountId], null)),\n unread: conversation.get('unread'),\n lastStatus: lastStatusId && getStatus(state, { id: lastStatusId }),\n };\n };\n};\n\nconst mapDispatchToProps = (dispatch, { intl, conversationId }) => ({\n\n markRead () {\n dispatch(markConversationRead(conversationId));\n },\n\n reply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n\n if (state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n delete () {\n dispatch(deleteConversation(conversationId));\n },\n\n onMute (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n onToggleHidden (status) {\n if (status.get('hidden')) {\n dispatch(revealStatus(status.get('id')));\n } else {\n dispatch(hideStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Conversation));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ConversationContainer from '../containers/conversation_container';\nimport ScrollableList from 'flavours/glitch/components/scrollable_list';\nimport { debounce } from 'lodash';\n\nexport default class ConversationsList extends ImmutablePureComponent {\n\n static propTypes = {\n conversations: ImmutablePropTypes.list.isRequired,\n hasMore: PropTypes.bool,\n isLoading: PropTypes.bool,\n onLoadMore: PropTypes.func,\n };\n\n getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id)\n\n handleMoveUp = id => {\n const elementIndex = this.getCurrentIndex(id) - 1;\n this._selectChild(elementIndex, true);\n }\n\n handleMoveDown = id => {\n const elementIndex = this.getCurrentIndex(id) + 1;\n this._selectChild(elementIndex, false);\n }\n\n _selectChild (index, align_top) {\n const container = this.node.node;\n const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n if (align_top && container.scrollTop > element.offsetTop) {\n element.scrollIntoView(true);\n } else if (!align_top && container.scrollTop + container.clientHeight < element.offsetTop + element.offsetHeight) {\n element.scrollIntoView(false);\n }\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n handleLoadOlder = debounce(() => {\n const last = this.props.conversations.last();\n\n if (last && last.get('last_status')) {\n this.props.onLoadMore(last.get('last_status'));\n }\n }, 300, { leading: true })\n\n render () {\n const { conversations, onLoadMore, ...other } = this.props;\n\n return (\n <ScrollableList {...other} onLoadMore={onLoadMore && this.handleLoadOlder} scrollKey='direct' ref={this.setRef}>\n {conversations.map(item => (\n <ConversationContainer\n key={item.get('id')}\n conversationId={item.get('id')}\n onMoveUp={this.handleMoveUp}\n onMoveDown={this.handleMoveDown}\n />\n ))}\n </ScrollableList>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport ConversationsList from '../components/conversations_list';\nimport { expandConversations } from 'flavours/glitch/actions/conversations';\n\nconst mapStateToProps = state => ({\n conversations: state.getIn(['conversations', 'items']),\n isLoading: state.getIn(['conversations', 'isLoading'], true),\n hasMore: state.getIn(['conversations', 'hasMore'], false),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onLoadMore: maxId => dispatch(expandConversations({ maxId })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ConversationsList);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';\nimport Column from 'flavours/glitch/components/column';\nimport ColumnHeader from 'flavours/glitch/components/column_header';\nimport { expandDirectTimeline } from 'flavours/glitch/actions/timelines';\nimport { mountConversations, unmountConversations, expandConversations } from 'flavours/glitch/actions/conversations';\nimport { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { connectDirectStream } from 'flavours/glitch/actions/streaming';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\nimport ConversationsListContainer from './containers/conversations_list_container';\n\nconst messages = defineMessages({\n title: { id: 'column.direct', defaultMessage: 'Direct messages' },\n});\n\nconst mapStateToProps = state => ({\n hasUnread: state.getIn(['timelines', 'direct', 'unread']) > 0,\n conversationsMode: state.getIn(['settings', 'direct', 'conversations']),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass DirectTimeline extends React.PureComponent {\n\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n columnId: PropTypes.string,\n intl: PropTypes.object.isRequired,\n hasUnread: PropTypes.bool,\n multiColumn: PropTypes.bool,\n conversationsMode: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('DIRECT', {}));\n }\n }\n\n handleMove = (dir) => {\n const { columnId, dispatch } = this.props;\n dispatch(moveColumn(columnId, dir));\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n componentDidMount () {\n const { dispatch, conversationsMode } = this.props;\n\n dispatch(mountConversations());\n\n if (conversationsMode) {\n dispatch(expandConversations());\n } else {\n dispatch(expandDirectTimeline());\n }\n\n this.disconnect = dispatch(connectDirectStream());\n }\n\n componentDidUpdate(prevProps) {\n const { dispatch, conversationsMode } = this.props;\n\n if (prevProps.conversationsMode && !conversationsMode) {\n dispatch(expandDirectTimeline());\n } else if (!prevProps.conversationsMode && conversationsMode) {\n dispatch(expandConversations());\n }\n }\n\n componentWillUnmount () {\n this.props.dispatch(unmountConversations());\n\n if (this.disconnect) {\n this.disconnect();\n this.disconnect = null;\n }\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMoreTimeline = maxId => {\n this.props.dispatch(expandDirectTimeline({ maxId }));\n }\n\n handleLoadMoreConversations = maxId => {\n this.props.dispatch(expandConversations({ maxId }));\n }\n\n handleTimelineClick = () => {\n this.props.dispatch(changeSetting(['direct', 'conversations'], false));\n }\n\n handleConversationsClick = () => {\n this.props.dispatch(changeSetting(['direct', 'conversations'], true));\n }\n\n render () {\n const { intl, hasUnread, columnId, multiColumn, conversationsMode } = this.props;\n const pinned = !!columnId;\n\n let contents;\n if (conversationsMode) {\n contents = (\n <ConversationsListContainer\n trackScroll={!pinned}\n scrollKey={`direct_timeline-${columnId}`}\n timelineId='direct'\n onLoadMore={this.handleLoadMore}\n emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage=\"You don't have any direct messages yet. When you send or receive one, it will show up here.\" />}\n />\n );\n } else {\n contents = (\n <StatusListContainer\n trackScroll={!pinned}\n scrollKey={`direct_timeline-${columnId}`}\n timelineId='direct'\n onLoadMore={this.handleLoadMoreTimeline}\n emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage=\"You don't have any direct messages yet. When you send or receive one, it will show up here.\" />}\n />\n );\n }\n\n return (\n <Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}>\n <ColumnHeader\n icon='envelope'\n active={hasUnread}\n title={intl.formatMessage(messages.title)}\n onPin={this.handlePin}\n onMove={this.handleMove}\n onClick={this.handleHeaderClick}\n pinned={pinned}\n multiColumn={multiColumn}\n >\n <ColumnSettingsContainer />\n </ColumnHeader>\n\n <div className='notification__filter-bar'>\n <button\n className={conversationsMode ? 'active' : ''}\n onClick={this.handleConversationsClick}\n >\n <FormattedMessage\n id='direct.conversations_mode'\n defaultMessage='Conversations'\n />\n </button>\n <button\n className={conversationsMode ? '' : 'active'}\n onClick={this.handleTimelineClick}\n >\n <FormattedMessage\n id='direct.timeline_mode'\n defaultMessage='Timeline'\n />\n </button>\n </div>\n\n {contents}\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} |