mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
closes #209
This commit is contained in:
@@ -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(''+username+'', '+uid+');', 'notification_' + uid + '_' + touid, function(nid) {
|
||||
notifications.push(nid, [touid], function(success) {
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user