var updateTypingStatus = function (isTyping, userId){ var currentUser = getUser(userId); if(isTyping && currentUser){ currentUser.typing = true; }else if (!isTyping && currentUser){ currentUser.typing = false; } if(currentUser){ var typingUsers = _.where(users, { typing : true }); var numberTyping = 0; if (typingUsers.length){ numberTyping = typingUsers.length; } io.emit('set-number-typing-users', currentUser.displayText, numberTyping); } }
return _.where(_contacts, { 'id': contactId })[0]; }, var existing = _.where(_contacts, { 'id': contact.id })[0]; if (!existing) { contact.is_new = true; var existing = _.where(_contacts, { 'id': contact.id })[0]; existing.editing = true; this.trigger(_contacts); var existing = _.where(_contacts, { 'id': contact.id })[0]; if (existing) { if (existing.is_new) {