Fixed article.from of twitter articles.
This commit is contained in:
parent
c8230207ef
commit
73bded92f7
1 changed files with 7 additions and 1 deletions
|
@ -12,11 +12,17 @@ class Observer::Ticket::Article::FillupFromGeneral < ActiveRecord::Observer
|
|||
# if article and sender type is set via *.postmaster)
|
||||
return if ApplicationHandleInfo.current.split('.')[1] == 'postmaster'
|
||||
|
||||
# set from on all article types excluding email
|
||||
# set from on all article types excluding email|twitter status|twitter direct-message|facebook feed post|facebook feed comment
|
||||
return if !record.type_id
|
||||
type = Ticket::Article::Type.lookup(id: record.type_id)
|
||||
return if type['name'] == 'email'
|
||||
|
||||
# from will be set by channel backend
|
||||
return if type['name'] == 'twitter status'
|
||||
return if type['name'] == 'twitter direct-message'
|
||||
return if type['name'] == 'facebook feed post'
|
||||
return if type['name'] == 'facebook feed comment'
|
||||
|
||||
return if !record.created_by_id
|
||||
user = User.find(record.created_by_id)
|
||||
record.from = "#{user.firstname} #{user.lastname}"
|
||||
|
|
Loading…
Reference in a new issue