Permalink
Browse files

fixed avatar uri

  • Loading branch information...
1 parent da77851 commit 678308043df1079a7478bb9909b0ea70121f63f5 @rizen committed Feb 11, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Chat/iFly.pm
View
@@ -814,7 +814,6 @@ sub init {
basePath => '/',
admin => (defined $user && exists $user->{is_admin} && $user->{is_admin}) ? "1" : "0",
session_key => '',
- up => (defined $user && exists $user->{avatar_uri}) ? $user->{avatar_uri} : $self->static_asset_base_uri.'/themes/'.$self->theme.'/images/default_avatar.png',
exurl => $self->ajax_uri,
external_host => $self->uri,
external_port => $self->port,
@@ -823,6 +822,12 @@ sub init {
upl => (defined $user && exists $user->{profile_uri} && $user->{profile_uri}) ? $user->{profile_uri} : '#',
);
+ if ($self->user_picture) {
+ $settings{default_up} = $self->static_asset_base_uri.'/themes/'.$self->theme.'/images/default_avatar.png';
+ $settings{up} = (defined $user && exists $user->{avatar_uri}) ? $user->{avatar_uri} : $settings{default_up};
+ $settings{default_cr} = $self->static_asset_base_uri.'/themes/'.$self->theme.'/images/default_room.png';
+ }
+
if ($self->show_admin_list) {
$settings{text_support_chat_init_label} = $self->support_chat_init_label;
$settings{text_support_chat_box_header} = $self->support_chat_box_header;
@@ -842,11 +847,6 @@ sub init {
$settings{stopWordList} = $self->stop_word_list;
}
- if ($self->user_picture) {
- $settings{up} = $settings{default_up} = $self->static_asset_base_uri.'/themes/'.$self->theme.'/images/default_avatar.png';
- $settings{default_cr} = $self->static_asset_base_uri.'/themes/'.$self->theme.'/images/default_room.png';
- }
-
return { drupalchat => \%settings };
}

0 comments on commit 6783080

Please sign in to comment.