Fixed twitter reply issue with multiple recipients.

This commit is contained in:
Martin Edenhofer 2016-10-15 01:54:40 +02:00
parent 214adfb450
commit baf54aaf8d
3 changed files with 14 additions and 7 deletions

View file

@ -211,12 +211,12 @@ class App.TicketZoomArticleActions extends App.Controller
recipients = article.from
if article.to
if recipients
recipients += ' '
recipients += ', '
recipients += article.to
if recipients
recipientString = ''
recipientScreenNames = recipients.split(' ')
recipientScreenNames = recipients.split(',')
for recipientScreenName in recipientScreenNames
# exclude already listed screen name

View file

@ -295,21 +295,29 @@ class App.TicketZoomArticleNew extends App.Controller
if params.type is 'twitter status'
rawHTML = @$('[data-name=body]').html()
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
if cleanHTML && cleanHTML.html() != rawHTML
# if markup is included, strip it out
if cleanHTML && cleanHTML.html() isnt rawHTML && "<div>#{cleanHTML.html()}</div>" isnt rawHTML
@$('[data-name=body]').html(cleanHTML)
params.content_type = 'text/plain'
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
if params.type is 'twitter direct-message'
rawHTML = @$('[data-name=body]').html()
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
if cleanHTML && cleanHTML.html() != rawHTML
# if markup is included, strip it out
if cleanHTML && cleanHTML.html() isnt rawHTML && "<div>#{cleanHTML.html()}</div>" isnt rawHTML
@$('[data-name=body]').html(cleanHTML)
params.content_type = 'text/plain'
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
if params.type is 'facebook feed comment'
rawHTML = @$('[data-name=body]').html()
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
if cleanHTML && cleanHTML.html() != rawHTML
# if markup is included, strip it out
if cleanHTML && cleanHTML.html() isnt rawHTML && "<div>#{cleanHTML.html()}</div>" isnt rawHTML
@$('[data-name=body]').html(cleanHTML)
params.content_type = 'text/plain'
params.body = App.Utils.html2text(params.body, true)
@ -372,7 +380,6 @@ class App.TicketZoomArticleNew extends App.Controller
return false
if params.type is 'twitter status'
params.body
textLength = @maxTextLength - params.body.length
return false if textLength < 0

View file

@ -163,7 +163,7 @@ class TweetBase
if !to
to = ''
else
to + ', '
to += ', '
end
to += "@#{local_user.screen_name}"
}