Chats: report user from message, fixes #391
This commit is contained in:
parent
ed4abfdce3
commit
41eb69ecd1
|
@ -25,6 +25,17 @@ export function initReport(account, status) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function initReportById(accountId) {
|
||||||
|
return (dispatch, getState) => {
|
||||||
|
dispatch({
|
||||||
|
type: REPORT_INIT,
|
||||||
|
account: getState().getIn(['accounts', accountId]),
|
||||||
|
});
|
||||||
|
|
||||||
|
dispatch(openModal('REPORT'));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export function cancelReport() {
|
export function cancelReport() {
|
||||||
return {
|
return {
|
||||||
type: REPORT_CANCEL,
|
type: REPORT_CANCEL,
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { escape, throttle } from 'lodash';
|
||||||
import { MediaGallery } from 'soapbox/features/ui/util/async-components';
|
import { MediaGallery } from 'soapbox/features/ui/util/async-components';
|
||||||
import Bundle from 'soapbox/features/ui/components/bundle';
|
import Bundle from 'soapbox/features/ui/components/bundle';
|
||||||
import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container';
|
import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container';
|
||||||
|
import { initReportById } from 'soapbox/actions/reports';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
today: { id: 'chats.dividers.today', defaultMessage: 'Today' },
|
today: { id: 'chats.dividers.today', defaultMessage: 'Today' },
|
||||||
|
@ -224,7 +225,7 @@ class ChatMessageList extends ImmutablePureComponent {
|
||||||
|
|
||||||
handleReportUser = (userId) => {
|
handleReportUser = (userId) => {
|
||||||
return () => {
|
return () => {
|
||||||
console.log(`should report user ${userId}`);
|
this.props.dispatch(initReportById(userId));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue