Skip to content

Commit

Permalink
If there is no chat, i.e., private server, don't try to set it up.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcbride committed Dec 2, 2014
1 parent 9ec406f commit 2b8d6ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/Lacuna/RPC/Chat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sub init_chat {

my $config = Lacuna->config;
my $firebase_config = $config->get('firebase');
return undef unless $firebase_config;
my $chat_auth = Firebase::Auth->new(
secret => $firebase_config->{auth}{secret},
# debug => \1,
Expand Down
21 changes: 12 additions & 9 deletions lib/Lacuna/RPC/Empire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,18 @@ sub login {
}
my $config = Lacuna->config;
my $firebase_config = $config->get('firebase');
my $auth_code = Firebase::Auth->new(
secret => $firebase_config->{auth}{secret},
data => {
uid => $empire->id,
isModerator => $empire->chat_admin ? \1 : \0,
isStaff => $empire->is_admin ? \1 : \0,
}
# data => $data,
)->create_token;
if ($firebase_config)
{
my $auth_code = Firebase::Auth->new(
secret => $firebase_config->{auth}{secret},
data => {
uid => $empire->id,
isModerator => $empire->chat_admin ? \1 : \0,
isStaff => $empire->is_admin ? \1 : \0,
}
# data => $data,
)->create_token;
}

if ($empire->is_password_valid($password)) {
if ($empire->stage eq 'new') {
Expand Down

0 comments on commit 2b8d6ff

Please sign in to comment.