Changeset acdd52e for lib/BarnOwl/Module/Twitter.pm
- Timestamp:
- May 7, 2009, 5:12:56 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- b56f2c3
- Parents:
- b25b5a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.