v1.18.x
Baris Usakli 12 years ago
parent ad5e3ebce3
commit 7cff55a160

@ -314,6 +314,18 @@ var socket,
});
}
app.openChat = function(username, touid) {
require(['chat'], function(chat) {
var chatModal;
if(!chat.modalExists(touid)) {
chatModal = chat.createModal(username, touid);
} else {
chatModal = chat.getModal(touid);
}
chat.load(chatModal.attr('UUID'));
});
}
app.createNewPosts = function(data) {
data.posts[0].display_moderator_tools = 'none';
var html = templates.prepare(templates['topic'].blocks['posts']).parse(data),

@ -288,15 +288,7 @@
if(username === app.username || !app.username)
return;
require(['chat'], function(chat) {
var chatModal;
if(!chat.modalExists(touid)) {
chatModal = chat.createModal(username, touid);
} else {
chatModal = chat.getModal(touid);
}
chat.load(chatModal.attr('UUID'));
});
app.openChat(username, touid);
});
ajaxify.register_events([

@ -533,7 +533,7 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
notifText = 'New message from <strong>' + username + '</strong>';
if(!isUserOnline(touid)) {
notifications.create(notifText, 5, '#', 'notification_' + uid + '_' + touid, function(nid) {
notifications.create(notifText, 5, 'javascript:app.openChat(&apos;'+username+'&apos;, '+uid+');', 'notification_' + uid + '_' + touid, function(nid) {
notifications.push(nid, [touid], function(success) {
});

Loading…
Cancel
Save