From cf94a71499b7351234862397aadba16d4bec8153 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 23 Apr 2014 21:47:51 -0400 Subject: [PATCH] closes #1427 flag and chat buttons are hidden on self posts, updated in vanilla and lavender --- public/language/en_GB/topic.json | 1 + src/socket.io/modules.js | 2 +- src/topics/posts.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json index 7669a23fe0..2af258a89d 100644 --- a/public/language/en_GB/topic.json +++ b/public/language/en_GB/topic.json @@ -10,6 +10,7 @@ "profile": "Profile", "posted_by": "Posted by %1", + "posted_by_guest": "Posted by Guest", "chat": "Chat", "notify_me": "Be notified of new replies in this topic", "quote": "Quote", diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js index 9d8d233c64..bc243855ab 100644 --- a/src/socket.io/modules.js +++ b/src/socket.io/modules.js @@ -162,7 +162,7 @@ SocketModules.chats.send = function(socket, data, callback) { return callback(new Error('[[error:invalid-data]]')); } - var touid = data.touid; + var touid = parseInt(data.touid, 10); if (touid === socket.uid || socket.uid === 0) { return; } diff --git a/src/topics/posts.js b/src/topics/posts.js index 6d59daf763..3062c5dfa9 100644 --- a/src/topics/posts.js +++ b/src/topics/posts.js @@ -68,6 +68,7 @@ module.exports = function(Topics) { postData[i].votes = postData[i].votes || 0; postData[i].display_moderator_tools = parseInt(uid, 10) !== 0 && results.privileges[i].editable; postData[i].display_move_tools = results.privileges[i].move; + postData[i].selfPost = parseInt(uid, 10) === parseInt(postData[i].uid, 10); if(postData[i].deleted && !results.privileges[i].view_deleted) { postData[i].content = '[[topic:post_is_deleted]]';