Fixed twitter reply issue with multiple recipients.
This commit is contained in:
parent
214adfb450
commit
baf54aaf8d
3 changed files with 14 additions and 7 deletions
|
@ -211,12 +211,12 @@ class App.TicketZoomArticleActions extends App.Controller
|
||||||
recipients = article.from
|
recipients = article.from
|
||||||
if article.to
|
if article.to
|
||||||
if recipients
|
if recipients
|
||||||
recipients += ' '
|
recipients += ', '
|
||||||
recipients += article.to
|
recipients += article.to
|
||||||
|
|
||||||
if recipients
|
if recipients
|
||||||
recipientString = ''
|
recipientString = ''
|
||||||
recipientScreenNames = recipients.split(' ')
|
recipientScreenNames = recipients.split(',')
|
||||||
for recipientScreenName in recipientScreenNames
|
for recipientScreenName in recipientScreenNames
|
||||||
|
|
||||||
# exclude already listed screen name
|
# exclude already listed screen name
|
||||||
|
|
|
@ -295,21 +295,29 @@ class App.TicketZoomArticleNew extends App.Controller
|
||||||
if params.type is 'twitter status'
|
if params.type is 'twitter status'
|
||||||
rawHTML = @$('[data-name=body]').html()
|
rawHTML = @$('[data-name=body]').html()
|
||||||
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
|
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)
|
@$('[data-name=body]').html(cleanHTML)
|
||||||
params.content_type = 'text/plain'
|
params.content_type = 'text/plain'
|
||||||
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
|
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
|
||||||
|
|
||||||
if params.type is 'twitter direct-message'
|
if params.type is 'twitter direct-message'
|
||||||
rawHTML = @$('[data-name=body]').html()
|
rawHTML = @$('[data-name=body]').html()
|
||||||
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
|
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)
|
@$('[data-name=body]').html(cleanHTML)
|
||||||
params.content_type = 'text/plain'
|
params.content_type = 'text/plain'
|
||||||
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
|
params.body = "#{App.Utils.html2text(params.body, true)}\n#{@signature.text()}"
|
||||||
|
|
||||||
if params.type is 'facebook feed comment'
|
if params.type is 'facebook feed comment'
|
||||||
rawHTML = @$('[data-name=body]').html()
|
rawHTML = @$('[data-name=body]').html()
|
||||||
cleanHTML = App.Utils.htmlRemoveRichtext(rawHTML)
|
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)
|
@$('[data-name=body]').html(cleanHTML)
|
||||||
params.content_type = 'text/plain'
|
params.content_type = 'text/plain'
|
||||||
params.body = App.Utils.html2text(params.body, true)
|
params.body = App.Utils.html2text(params.body, true)
|
||||||
|
@ -372,7 +380,6 @@ class App.TicketZoomArticleNew extends App.Controller
|
||||||
return false
|
return false
|
||||||
|
|
||||||
if params.type is 'twitter status'
|
if params.type is 'twitter status'
|
||||||
params.body
|
|
||||||
textLength = @maxTextLength - params.body.length
|
textLength = @maxTextLength - params.body.length
|
||||||
return false if textLength < 0
|
return false if textLength < 0
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ class TweetBase
|
||||||
if !to
|
if !to
|
||||||
to = ''
|
to = ''
|
||||||
else
|
else
|
||||||
to + ', '
|
to += ', '
|
||||||
end
|
end
|
||||||
to += "@#{local_user.screen_name}"
|
to += "@#{local_user.screen_name}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue