Merge branch 'master' into server-jest

This commit is contained in:
Belén Curcio
2018-04-17 13:01:19 -03:00
committed by GitHub
10 changed files with 170 additions and 72 deletions
@@ -75,6 +75,7 @@ class SignUp extends React.Component {
showErrors={!!emailError}
errorMsg={emailError}
onChange={this.handleEmailChange}
autocomplete="off"
/>
<TextField
id="username"
@@ -85,6 +86,8 @@ class SignUp extends React.Component {
showErrors={!!usernameError}
errorMsg={usernameError}
onChange={this.handleUsernameChange}
autocomplete="off"
autocapitalize="none"
/>
<TextField
id="password"
@@ -96,6 +99,7 @@ class SignUp extends React.Component {
errorMsg={passwordError}
onChange={this.handlePasswordChange}
minLength="8"
autocomplete="off"
/>
{passwordError && (
<span className={styles.hint}>
@@ -113,6 +117,7 @@ class SignUp extends React.Component {
errorMsg={passwordRepeatError}
onChange={this.handlePasswordRepeatChange}
minLength="8"
autocomplete="off"
/>
<Slot
fill="talkPluginAuth.formField"
@@ -1,4 +1,4 @@
const { get } = require('lodash');
const { get, map } = require('lodash');
const path = require('path');
const handle = async (ctx, comment) => {
@@ -23,6 +23,9 @@ const handle = async (ctx, comment) => {
id
user {
id
ignoredUsers {
id
}
notificationSettings {
onReply
}
@@ -53,13 +56,23 @@ const handle = async (ctx, comment) => {
return;
}
// Pull out the author of the new comment.
const authorID = get(comment, 'author_id');
// Check to see if this is yourself replying to yourself, if that's the case
// don't send a notification.
if (userID === get(comment, 'author_id')) {
if (userID === authorID) {
ctx.log.info('user id of parent comment is the same as the new comment');
return;
}
// Check to see if this user is ignoring the user who replied to their
// comment.
if (map(get(comment, 'user.ignoredUsers', []), 'id').indexOf(authorID)) {
ctx.log.info('parent user has ignored the author of the new comment');
return;
}
// The user does have notifications for replied comments enabled, queue the
// notification to be sent.
return { userID, date: comment.created_at, context: comment.id };