From 48a5292249090edef2209156a0854c596769504c Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 12 Aug 2015 16:24:09 +0500 Subject: [PATCH] fix of deleting user mention from mentions to reply --- js/twister_formatpost.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 4f6c7d4..bfb79df 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -138,11 +138,10 @@ function postToElem(post, kind, promoted) { if (username !== defaultScreenName) { if (msg.mentions.indexOf(username) === -1) msg.mentions.splice(0, 0, username); - } else { - var i = msg.mentions.indexOf(defaultScreenName); - if (i !== -1) - msg.mentions.splice(i, 1); } + for (var i = msg.mentions.indexOf(defaultScreenName); i !== -1; i = msg.mentions.indexOf(defaultScreenName)) + msg.mentions.splice(i, 1); + if (msg.mentions.length) var replyTo = '@' + msg.mentions.join(' @') + ' '; else