From 2b5ec4a3c076bb1f18eeafbd96b0a80c6b8bfbaa Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 15 Oct 2015 10:44:04 -0400 Subject: Small refactor of websocket code on client and server --- web/react/utils/constants.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'web/react/utils') diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index b7b8d3c60..b2e9bc6a7 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -47,6 +47,18 @@ module.exports = { SERVER_ACTION: null, VIEW_ACTION: null }), + + SocketEvents: { + POSTED: 'posted', + POST_EDITED: 'post_edited', + POST_DELETED: 'post_deleted', + CHANNEL_VIEWED: 'channel_viewed', + NEW_USER: 'new_user', + USER_ADDED: 'user_added', + USER_REMOVED: 'user_removed', + TYPING: 'user_typing' + }, + SPECIAL_MENTIONS: ['all', 'channel'], CHARACTER_LIMIT: 4000, IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png', 'jpeg'], -- cgit v1.2.3-1-g7c22 From 20723437aa607abdfa0e9353927e8bf8694a6b2c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 15 Oct 2015 10:57:09 -0400 Subject: Fix typing socket constant --- web/react/utils/constants.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index b2e9bc6a7..5eb8378ca 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -56,7 +56,7 @@ module.exports = { NEW_USER: 'new_user', USER_ADDED: 'user_added', USER_REMOVED: 'user_removed', - TYPING: 'user_typing' + TYPING: 'typing' }, SPECIAL_MENTIONS: ['all', 'channel'], -- cgit v1.2.3-1-g7c22 From 6e350cb9b9f5641fc553c55d43c07e1bcd9f2756 Mon Sep 17 00:00:00 2001 From: Joel Vasallo Date: Fri, 16 Oct 2015 11:26:28 -0500 Subject: Updated Email Check Regex to RFC5322 Standard --- web/react/utils/utils.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 561c2c4c4..38ac68d58 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -13,7 +13,8 @@ var client = require('./client.jsx'); var Autolinker = require('autolinker'); export function isEmail(email) { - var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; + //var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; + var regex = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i; return regex.test(email); } -- cgit v1.2.3-1-g7c22