Convos

 view release on metacpan or  search on metacpan

CHANGELOG.md  view on Meta::CPAN

## 0.85 (2014-10-24)
- Fix input field in iOS #167
- Fix nick-list event #197
- Fix rendering /list command with correct height #205
- Fix wrong kick message #206
- Fix scrolling to bottom when gist load #207
- Fix sending server messages to server log, instead of opening new conversation #209
- Fix uppercase characters in login name #211
- Fix handling of nicks starting with "[" or "}" #219
- Stop backend from going bananas, using Daemon::Control #224
  - Remove CONVOS_BACKEND_EMBEDDED as exposed variable
  - Remove CONVOS_MANUAL_BACKEND
- Add delete_user() to Convos::Core #104
- Add feedback when websocket could not be established #192
- Add /profile/delete #104
- Add detection if unable to connect to websocket #173
- Add Convos::Manual::Running #224
  - https://github.com/Nordaaker/convos/blob/master/lib/Convos/Manual/Running.pod
- Add improved embed of media with Mojolicious::Plugin::LinkEmbedder 0.12
  * Fix embedding YouTube video over https
  * Fix video site that also contain meta information, but no video

lib/Convos.pm  view on Meta::CPAN

  if ($ENV{CONVOS_TEMPLATES}) {

    # Using push() since I don't think it's a good idea for allowing the user
    # to customize every template, at least not when the application is still
    # unstable.
    push @{$self->renderer->paths}, $ENV{CONVOS_TEMPLATES};
  }

  $self->defaults(full_page => 1, organization_name => $self->config('name'));
  $self->hook(before_dispatch => \&_before_dispatch);
  $self->_embed_backend if $ENV{CONVOS_BACKEND_EMBEDDED};

  Scalar::Util::weaken($self);
  Mojo::IOLoop->timer(0 => sub { $self->_set_secrets });
}

sub _assets {
  my $self = shift;

  $self->plugin('AssetPack');
  $self->plugin('FontAwesome4', css => []);

lib/Convos/Manual/Environment.pod  view on Meta::CPAN


=head2 CONVOS_ARCHIVE_DIR

Set this variable to a custom directory where Convos can store the IRC
logs.

=head2 CONVOS_DEBUG

Set CONVOS_DEBUG to a true value for extra debug output to STDERR.

=head2 CONVOS_DISABLE_AUTO_EMBED

Set CONVOS_DISABLE_AUTO_EMBED to a true value to disable links from expanding
into images, movies or other dynamic content.

=head2 CONVOS_ORGANIZATION_NAME

Set this to customize the organization name on the landing page, in the title
tag and other various sites. The default is L<Nordaaker|http://nordaaker.com/>.

=head2 CONVOS_REDIS_URL

This is the URL to the Redis backend, and should follow this format:

lib/Convos/Plugin/Helpers.pm  view on Meta::CPAN


=cut

use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON 'j';
use Convos::Core::Util qw( format_time id_as );
use URI::Find;
use constant DEBUG        => $ENV{CONVOS_DEBUG}        || 0;
use constant DEFAULT_URL  => $ENV{DEFAULT_AVATAR_URL}  || 'https://graph.facebook.com/%s/picture?height=40&width=40';
use constant GRAVATAR_URL => $ENV{GRAVATAR_AVATAR_URL} || 'https://gravatar.com/avatar/%s?s=40&d=retro';
use constant DISABLE_AUTO_EMBED => $ENV{CONVOS_DISABLE_AUTO_EMBED} || 0;

=head1 HELPERS

=head2 active_class

Will add "active" class to a link based on url

=cut

sub active_class {

lib/Convos/Plugin/Helpers.pm  view on Meta::CPAN

      }

      $cache->{$user} = $message->{avatar};
      $cb->();
    }
  );
}

sub _parse_message {
  my ($c, $message, $delay) = @_;
  my @class = DISABLE_AUTO_EMBED ? () : (class => 'external');

  # http://www.mirc.com/colors.html
  $message->{message} =~ s/\x03\d{0,15}(,\d{0,15})?//g;
  $message->{message} =~ s/[\x00-\x1f]//g;

  $message->{highlight} ||= 0;
  $message->{message} = Mojo::Util::xml_escape($message->{message});

  URI::Find->new(
    sub {

script/convos  view on Meta::CPAN

use File::Spec;
use lib "$FindBin::Bin/../lib";

if (@ARGV) {
  if (my $action = (grep { $_ eq $ARGV[0] } qw( backend daemon frontend help upgrade version ))[0]) {
    $ENV{MOJO_MODE} ||= 'production';
    exec File::Spec->catfile($FindBin::Bin, 'convos-backend')  => do { shift @ARGV; @ARGV } if $action eq 'backend';
    exec File::Spec->catfile($FindBin::Bin, 'convos-frontend') => do { shift @ARGV; @ARGV } if $action eq 'frontend';
  }

  $ENV{CONVOS_BACKEND_EMBEDDED} //= 1 if $ARGV[0] eq 'daemon';
  $ENV{CONVOS_BACKEND_ONLY} = $ENV{CONVOS_REDIS_URL} = 'invalid://' if $ARGV[0] eq 'help';
}
test_mode() if $ENV{CONVOS_REDIS_URL} and $ENV{CONVOS_REDIS_URL} =~ s,^test\b(?![.-])(\://)?,,;

require Mojolicious::Commands;
require Convos;
my $commands = Mojolicious::Commands->new(app => Convos->new);
unshift @{$commands->namespaces}, 'Convos::Command';
$commands->run(@ARGV);

t/embedded.t  view on Meta::CPAN

BEGIN { $ENV{MOJO_MODE} = 'production' }
use t::Helper;
use Test::Mojo;
use Test::More;
use File::Spec;
use Convos::Core;

delete $SIG{USR2};
$ENV{CONVOS_BACKEND_EMBEDDED} = 1;
$ENV{TMPDIR}                  = 't';

unlink 't/convos-backend.pid';
plan skip_all => 'Custom TMPDIR is required' unless File::Spec->tmpdir eq $ENV{TMPDIR};

no warnings 'redefine';
my $start = 0;
*Convos::Core::start = sub { $start++ };

my $t = Test::Mojo->new('Convos');

t/start-with-embedded-server.t  view on Meta::CPAN

use Mojo::Base -base;
use Test::More;
use Convos;

$ENV{CONVOS_BACKEND_PID_FILE} = File::Spec->catfile(File::Spec->tmpdir, 'convos-test-backend.pid');
$ENV{CONVOS_REDIS_URL} = 'localhost:123456789';

{
  local $SIG{USR2} = sub { };                # emulate hypnotoad (hackish)
  local $ENV{CONVOS_BACKEND_EMBEDDED} = 1;
  eval { Convos->new };
  like $@, qr{Cannot start embedded backend from hypnotoad}, 'cannot start CONVOS_BACKEND_EMBEDDED with hypnotoad';
}

{
  my ($start, $got_pid) = (0, 0);
  local $ENV{CONVOS_BACKEND_EMBEDDED} = 1;
  local *Convos::Core::start = sub {
    $got_pid = -e $ENV{CONVOS_BACKEND_PID_FILE};
    $start++;
  };
  eval { Convos->new };
  is $start, 1, 'backend started';
  ok !-e $ENV{CONVOS_BACKEND_PID_FILE}, 'pid file was cleaned up';
  ok $got_pid, 'pid file was created';
}



( run in 1.408 second using v1.01-cache-2.11-cpan-71847e10f99 )