Fixed recipient list (exclude now username) on twitter reply.

This commit is contained in:
Martin Edenhofer 2016-10-30 00:17:35 +02:00
parent 082e087797
commit 7cbe4f9da1

View file

@ -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 = 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} "