Skip to content

Commit

Permalink
added debug event for tracking events
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper committed Mar 26, 2012
1 parent e90e547 commit 60213c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions New/Omegle.pm
Expand Up @@ -13,7 +13,7 @@ use JSON;
use URI::Escape::XS;

our ($VERSION, $online, $ua, @servers,
$updated, $lastserver, %response) = (3.2, 0, Furl->new);
$updated, $lastserver, %response) = (3.3, 0, Furl->new);

# New::Omegle->new(%opts)
# creates a new New::Omegle session instance.
Expand Down Expand Up @@ -177,6 +177,7 @@ sub fire {
# handles a single event from parsed JSON. intended for internal use.
sub handle_event {
my ($om, @event) = @_;
$om->fire('debug', $event[0].'('.join(', ', @event[1..$#event]).')');

given ($event[0]) {

Expand Down Expand Up @@ -261,7 +262,7 @@ sub handle_event {
$om->fire('count', $event[1]);
}


# an error has occured and the session must end
when ('error') {
$om->fire('error', $event[1]);
delete $om->{id};
Expand Down

0 comments on commit 60213c8

Please sign in to comment.