removed notify typing code, not even working

v1.18.x
barisusakli 9 years ago
parent 78bb4776df
commit 8bc80abde6

@ -204,7 +204,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
return;
}
Chats.notifyTyping(roomId, val);
$(this).attr('data-typing', val);
});
@ -370,14 +369,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
}
});
socket.on('event:chats.userStartTyping', function(withUid) {
$('.chats-list li[data-uid="' + withUid + '"]').addClass('typing');
});
socket.on('event:chats.userStopTyping', function(withUid) {
$('.chats-list li[data-uid="' + withUid + '"]').removeClass('typing');
});
socket.on('event:user_status_change', function(data) {
app.updateUserStatus($('.chats-list [data-uid="' + data.uid + '"] [component="user/status"]'), data.status);
});
@ -423,13 +414,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
Chats.setActive();
};
Chats.notifyTyping = function(roomId, typing) {
socket.emit('modules.chats.user' + (typing ? 'Start' : 'Stop') + 'Typing', {
roomId: roomId,
fromUid: app.user.uid
});
};
Chats.sendMessage = function(roomId, inputEl) {
var msg = inputEl.val();
var mid = inputEl.attr('data-mid');
@ -458,7 +442,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
}
sounds.play('chat-outgoing');
Chats.notifyTyping(roomId, false);
});
} else {
socket.emit('modules.chats.edit', {
@ -470,7 +453,6 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
return app.alertError(err.message);
}
Chats.notifyTyping(roomId, false);
});
}
};

@ -65,25 +65,6 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
}
});
socket.on('event:chats.userStartTyping', function(withUid) {
var modal = module.getModal(withUid);
var chatContent = modal.find('.chat-content');
if (!chatContent.length) {
return;
}
var atBottom = chatContent[0].scrollHeight - chatContent.scrollTop() === chatContent.innerHeight();
modal.find('.user-typing').removeClass('hide');
if (atBottom) {
Chats.scrollToBottom(chatContent);
}
});
socket.on('event:chats.userStopTyping', function(withUid) {
var modal = module.getModal(withUid);
modal.find('.user-typing').addClass('hide');
});
socket.on('event:user_status_change', function(data) {
var modal = module.getModal(data.uid);
app.updateUserStatus(modal.find('[component="user/status"]'), data.status);
@ -322,7 +303,6 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
chatModal.remove();
chatModal.data('modal', null);
taskbar.discard('chat', chatModal.attr('UUID'));
Chats.notifyTyping(chatModal.attr('roomId'), false);
if (chatModal.attr('data-mobile')) {
module.disableMobileBehaviour(chatModal);
@ -391,7 +371,6 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
taskbar.minimize('chat', uuid);
clearInterval(chatModal.attr('intervalId'));
chatModal.attr('intervalId', 0);
Chats.notifyTyping(chatModal.attr('roomId'), false);
};
module.toggleNew = taskbar.toggleNew;

@ -266,31 +266,6 @@ SocketModules.chats.renameRoom = function(socket, data, callback) {
], callback);
};
SocketModules.chats.userStartTyping = function(socket, data, callback) {
sendTypingNotification('event:chats.userStartTyping', socket, data, callback);
};
SocketModules.chats.userStopTyping = function(socket, data, callback) {
sendTypingNotification('event:chats.userStopTyping', socket, data, callback);
};
function sendTypingNotification(event, socket, data, callback) {
if (!socket.uid || !data || !data.roomId) {
return;
}
Messaging.getUidsInRoom(data.roomId, 0, -1, function(err, uids) {
if (err) {
return callback(err);
}
uids.forEach(function(uid) {
if (socket.uid !== parseInt(uid, 10)) {
server.in('uid_' + uid).emit(event, data.fromUid);
}
});
});
}
SocketModules.chats.getRecentChats = function(socket, data, callback) {
if (!data || !utils.isNumber(data.after)) {
return callback(new Error('[[error:invalid-data]]'));

Loading…
Cancel
Save