From e7b9eab5b607624d0e98ee9f8cc1c950758fc07d Mon Sep 17 00:00:00 2001 From: Klaus Date: Wed, 2 Aug 2017 14:05:20 -0300 Subject: [PATCH] Move makeCall to service file --- .../imports/ui/components/chat/chat-dropdown/component.jsx | 3 +-- bigbluebutton-html5/imports/ui/components/chat/service.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx index ee97bfc169..4b520b1372 100755 --- a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx @@ -10,7 +10,6 @@ import DropdownTrigger from '/imports/ui/components/dropdown/trigger/component'; import DropdownContent from '/imports/ui/components/dropdown/content/component'; import DropdownList from '/imports/ui/components/dropdown/list/component'; import DropdownListItem from '/imports/ui/components/dropdown/list/item/component'; -import { makeCall } from '/imports/ui/services/api'; import Auth from '/imports/ui/services/auth'; import Chats from '/imports/api/2.0/chat'; import Acl from '/imports/startup/acl'; @@ -117,7 +116,7 @@ class ChatDropdown extends Component { icon={clearIcon} label={intl.formatMessage(intlMessages.clear)} key={_.uniqueId('action-item-')} - onClick={() => makeCall('clearPublicChatHistory')} + onClick={ChatService.clearPublicChatHistory} /> : null), ]); diff --git a/bigbluebutton-html5/imports/ui/components/chat/service.js b/bigbluebutton-html5/imports/ui/components/chat/service.js index 2287a367fd..80bba0bf73 100644 --- a/bigbluebutton-html5/imports/ui/components/chat/service.js +++ b/bigbluebutton-html5/imports/ui/components/chat/service.js @@ -1,11 +1,9 @@ import Chats from '/imports/api/2.0/chat'; import Users from '/imports/api/2.0/users'; - import Auth from '/imports/ui/services/auth'; import UnreadMessages from '/imports/ui/services/unread-messages'; import Storage from '/imports/ui/services/storage/session'; import mapUser from '/imports/ui/services/user/mapUser'; - import { makeCall } from '/imports/ui/services/api'; import _ from 'lodash'; @@ -191,6 +189,8 @@ const updateUnreadMessage = (receiverID, timestamp) => { return UnreadMessages.update(chatType, timestamp); }; +const clearPublicChatHistory = () => (makeCall('clearPublicChatHistory')); + const closePrivateChat = (chatID) => { const currentClosedChats = Storage.getItem(CLOSED_CHAT_LIST_KEY) || []; @@ -237,4 +237,5 @@ export default { sendMessage, closePrivateChat, exportChat, + clearPublicChatHistory, };