|
|
|
@ -320,25 +320,11 @@ var socket,
|
|
|
|
|
|
|
|
|
|
app.openChat = function (username, touid) {
|
|
|
|
|
if (username === app.username) {
|
|
|
|
|
app.alert({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
title: 'Invalid Chat',
|
|
|
|
|
message: "You can't chat with yourself!",
|
|
|
|
|
timeout: 5000
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
return app.alertError('[[error:cant-chat-with-yourself]]');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!app.uid) {
|
|
|
|
|
app.alert({
|
|
|
|
|
type: 'danger',
|
|
|
|
|
title: 'Not Logged In',
|
|
|
|
|
message: 'Please log in to chat with <strong>' + username + '</strong>',
|
|
|
|
|
timeout: 5000
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
return app.alertError('[[error:not-logged-in]]');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
require(['chat'], function (chat) {
|
|
|
|
|