Permalink
Browse files

Room: let the caller specify since_message_id

Until now we always just used our local last_message id. But
the caller may want to keep outside of a single run.
  • Loading branch information...
peff committed Feb 16, 2011
1 parent c9f1231 commit e51c09bbfd169dad5b4c4a59f407face2af00c69
Showing with 2 additions and 4 deletions.
  1. +2 −4 Campfire/Room.pm
View
@@ -10,14 +10,12 @@ sub id { _accessor(id => @_) }
sub recent {
my $self = shift;
my $limit = shift;
my $since = shift || $self->{last_message};
my $xml = $self->{parent}->_get(
join('/', 'room', $self->id, 'recent'),
(defined $limit ? (limit => $limit) : ()),
(defined $self->{last_message} ?
(since_message_id => $self->{last_message}) :
()
),
(defined $since ? (since_message_id => $since) : ()),
);
return unless exists $xml->{messages}->{message};

0 comments on commit e51c09b

Please sign in to comment.