- Timestamp:
- May 7, 2009, 5:12:56 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- b56f2c3
- Parents:
- b25b5a4
- Location:
- lib/BarnOwl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/BarnOwl/Message/Twitter.pm
r6babb75 racdd52e 21 21 if($self->is_private) { 22 22 return $self->replysendercmd; 23 } elsif(exists($self->{status_id})) { 24 return 'twitter-atreply ' . $self->sender . " " . $self->{status_id}; 23 25 } else { 24 return 'twitter-atreply ' .$self->sender;26 return 'twitter-atreply ' . $self->sender; 25 27 } 26 28 } -
lib/BarnOwl/Module/Twitter.pm
rb25b5a4 racdd52e 183 183 source => decode_entities($tweet->{source}), 184 184 location => decode_entities($tweet->{user}{location}||""), 185 body => decode_entities($tweet->{text}) 185 body => decode_entities($tweet->{text}), 186 status_id => $tweet->{id} 186 187 ); 187 188 BarnOwl::queue_message($msg); … … 227 228 sub twitter { 228 229 my $msg = shift; 230 my $reply_to = shift; 231 229 232 if($msg =~ m{\Ad\s+([^\s])+(.*)}sm) { 230 233 twitter_direct($1, $2); 231 234 } elsif(defined $twitter) { 232 $twitter->update($msg); 235 $twitter->update({ 236 status => $msg, 237 defined($reply_to) ? (in_reply_to_status_id => $reply_to) : () 238 }); 233 239 } 234 240 } … … 258 264 sub twitter_atreply { 259 265 my $to = shift; 266 my $id = shift; 260 267 my $msg = shift; 261 twitter("@".$to." ".$msg); 268 if(defined($id)) { 269 twitter("@".$to." ".$msg, $id); 270 } else { 271 twitter("@".$to." ".$msg); 272 } 262 273 } 263 274 … … 303 314 sub cmd_twitter_atreply { 304 315 my $cmd = shift; 305 my $user = shift; 306 BarnOwl::start_edit_win("Reply to \@" . $user, sub { twitter_atreply($user, shift) }); 316 my $user = shift || die("Usage: $cmd USER [In-Reply-To ID]\n"); 317 my $id = shift; 318 BarnOwl::start_edit_win("Reply to \@" . $user, sub { twitter_atreply($user, $id, shift) }); 307 319 } 308 320
Note: See TracChangeset
for help on using the changeset viewer.