Files
jitsi-meet/react/features/chat/actions.any.js
robertpin 584ec7c82e fix(reactions) Reactions improvements (#9964)
* Register shortcuts on mount

* Changed icon for reactions menu

* Enable reactions by default

* Fix unreadCount bug

When having unread messages and sending a reaction the unread count now shows the correct count

* Fix overflow menu bottom color when reactions are enabled

* Revert raise hand icon

* Update raise hand functionality

On desktop show raise button with arrow for reactions. Only show raise hand in the reactions menu on mobile

* Fix lint error

Add required prop to ToolboxButtonWithIcon

* Legacy support for enable reactions

If disableReactions is undefined treat it as true

* Remove unnecessary code

* Fix unread counter showing negative count

* Fix unreadCount with reactions

UnreadCount ignores all reactions messages

* Fixed typo

* Fix background color
2021-09-21 12:30:24 -05:00

117 lines
2.8 KiB
JavaScript

// @flow
import {
ADD_MESSAGE,
CLEAR_MESSAGES,
CLOSE_CHAT,
SEND_MESSAGE,
SET_PRIVATE_MESSAGE_RECIPIENT,
SET_IS_POLL_TAB_FOCUSED
} from './actionTypes';
/**
* Adds a chat message to the collection of messages.
*
* @param {Object} messageDetails - The chat message to save.
* @param {string} messageDetails.displayName - The displayName of the
* participant that authored the message.
* @param {boolean} messageDetails.hasRead - Whether or not to immediately mark
* the message as read.
* @param {string} messageDetails.message - The received message to display.
* @param {string} messageDetails.messageType - The kind of message, such as
* "error" or "local" or "remote".
* @param {string} messageDetails.timestamp - A timestamp to display for when
* the message was received.
* @param {string} messageDetails.isReaction - Whether or not the
* message is a reaction message.
* @returns {{
* type: ADD_MESSAGE,
* displayName: string,
* hasRead: boolean,
* message: string,
* messageType: string,
* timestamp: string,
* isReaction: boolean
* }}
*/
export function addMessage(messageDetails: Object) {
return {
type: ADD_MESSAGE,
...messageDetails
};
}
/**
* Clears the chat messages in Redux.
*
* @returns {{
* type: CLEAR_MESSAGES
* }}
*/
export function clearMessages() {
return {
type: CLEAR_MESSAGES
};
}
/**
* Action to signal the closing of the chat dialog.
*
* @returns {{
* type: CLOSE_CHAT
* }}
*/
export function closeChat() {
return {
type: CLOSE_CHAT
};
}
/**
* Sends a chat message to everyone in the conference.
*
* @param {string} message - The chat message to send out.
* @param {boolean} ignorePrivacy - True if the privacy notification should be ignored.
* @returns {{
* type: SEND_MESSAGE,
* ignorePrivacy: boolean,
* message: string
* }}
*/
export function sendMessage(message: string, ignorePrivacy: boolean = false) {
return {
type: SEND_MESSAGE,
ignorePrivacy,
message
};
}
/**
* Initiates the sending of a private message to the supplied participant.
*
* @param {Participant} participant - The participant to set the recipient to.
* @returns {{
* participant: Participant,
* type: SET_PRIVATE_MESSAGE_RECIPIENT
* }}
*/
export function setPrivateMessageRecipient(participant: Object) {
return {
participant,
type: SET_PRIVATE_MESSAGE_RECIPIENT
};
}
/**
* Set the value of _isPollsTabFocused.
*
* @param {boolean} isPollsTabFocused - The new value for _isPollsTabFocused.
* @returns {Function}
*/
export function setIsPollsTabFocused(isPollsTabFocused: boolean) {
return {
isPollsTabFocused,
type: SET_IS_POLL_TAB_FOCUSED
};
}