From 7cbe4f9da1b78b36a356c0c7479df82671b2a3ad Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 30 Oct 2016 00:17:35 +0200 Subject: [PATCH] Fixed recipient list (exclude now username) on twitter reply. --- .../ticket_zoom/article_actions.coffee | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.coffee index a7ae281b7..4a552ac44 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_actions.coffee @@ -218,15 +218,22 @@ class App.TicketZoomArticleActions extends App.Controller recipientString = '' recipientScreenNames = recipients.split(',') for recipientScreenName in recipientScreenNames + if recipientScreenName + recipientScreenName = recipientScreenName.trim().toLowerCase() - # exclude already listed screen name - if !body || !body.match(recipientScreenName) + # exclude already listed screen name + exclude = false + if body && body.toLowerCase().match(recipientScreenName) + exclude = true # exclude own screen_name - if !body || !body.match(@ticket.preferences.channel_screen_name) + if recipientScreenName is "@#{@ticket.preferences.channel_screen_name}".toLowerCase() + exclude = true + + if exclude is false if recipientString isnt '' recipientString += ' ' - recipientString += recipientScreenName.trim() + recipientString += recipientScreenName if body articleNew.body = "#{recipientString} #{body} "