feat: Standardise the external channel user id and user name (#8802)
* feat: Standardize the external channel id and user name * chore: add specs * chore: add name space `social`
This commit is contained in:
@@ -24,7 +24,9 @@ class Instagram::WebhooksBaseService
|
||||
def update_instagram_profile_link(user)
|
||||
return unless user['username']
|
||||
|
||||
# TODO: Remove this once we show the social_instagram_user_name in the UI instead of the username
|
||||
@contact.additional_attributes = @contact.additional_attributes.merge({ 'social_profiles': { 'instagram': user['username'] } })
|
||||
@contact.additional_attributes = @contact.additional_attributes.merge({ 'social_instagram_user_name': user['username'] })
|
||||
@contact.save
|
||||
end
|
||||
end
|
||||
|
||||
@@ -139,7 +139,14 @@ class Line::IncomingMessageService
|
||||
def contact_attributes
|
||||
{
|
||||
name: line_contact_info['displayName'],
|
||||
avatar_url: line_contact_info['pictureUrl']
|
||||
avatar_url: line_contact_info['pictureUrl'],
|
||||
additional_attributes: additional_attributes
|
||||
}
|
||||
end
|
||||
|
||||
def additional_attributes
|
||||
{
|
||||
social_line_user_id: line_contact_info['userId']
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -78,8 +78,11 @@ class Telegram::IncomingMessageService
|
||||
|
||||
def additional_attributes
|
||||
{
|
||||
# TODO: Remove this once we show the social_telegram_user_name in the UI instead of the username
|
||||
username: telegram_params_username,
|
||||
language_code: telegram_params_language_code
|
||||
language_code: telegram_params_language_code,
|
||||
social_telegram_user_id: telegram_params_from_id,
|
||||
social_telegram_user_name: telegram_params_username
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user