mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Merge branch 'master' into moderation-refactor
This commit is contained in:
@@ -73,10 +73,20 @@ const createAction = async (
|
||||
metadata,
|
||||
});
|
||||
|
||||
if (action_type === 'FLAG' && item_type === 'COMMENTS') {
|
||||
// The item is a comment, and this is a flag. Push that the comment was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('commentFlagged', item);
|
||||
if (action_type === 'FLAG') {
|
||||
switch (item_type) {
|
||||
case 'COMMENTS':
|
||||
// The item is a comment, and this is a flag. Push that the comment was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('commentFlagged', item);
|
||||
break;
|
||||
case 'USERS':
|
||||
// The item is a user, and this is a flag. Push that the user was
|
||||
// flagged, don't wait for it to finish.
|
||||
pubsub.publish('usernameFlagged', item);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return action;
|
||||
|
||||
@@ -56,7 +56,10 @@ const stopIgnoringUser = ({ user }, userToStopIgnoring) => {
|
||||
};
|
||||
|
||||
const changeUsername = async (ctx, id, username) => {
|
||||
return UsersService.changeUsername(id, username, ctx.user.id);
|
||||
const user = await UsersService.changeUsername(id, username, ctx.user.id);
|
||||
const previousUsername = ctx.user.username;
|
||||
ctx.pubsub.publish('usernameChanged', { previousUsername, user });
|
||||
return user;
|
||||
};
|
||||
|
||||
const setUsername = async (ctx, id, username) => {
|
||||
|
||||
Reference in New Issue
Block a user