Changeset 513da71 for lib/BarnOwl/Module/Twitter.pm
- Timestamp:
- Aug 4, 2009, 2:23:28 AM (16 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 4bd9327
- Parents:
- 82e0f26
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/BarnOwl/Module/Twitter.pm
refcd223 r513da71 218 218 } 219 219 220 sub twitter_follow { 221 my $account = shift; 222 223 if (defined $account) { 224 my $handle = find_account($account); 225 $handle->twitter_follow(@_); 226 } elsif (defined $default_handle) { 227 $default_handle->twitter_follow(@_); 228 } 229 else { 230 $twitter_handles[0]->twitter_follow(@_); 231 } 232 } 233 234 sub twitter_unfollow { 235 my $account = shift; 236 237 if (defined $account) { 238 my $handle = find_account($account); 239 $handle->twitter_unfollow(@_); 240 } elsif (defined $default_handle) { 241 $default_handle->twitter_unfollow(@_); 242 } 243 else { 244 $twitter_handles[0]->twitter_unfollow(@_); 245 } 246 } 247 220 248 BarnOwl::new_command(twitter => \&cmd_twitter, { 221 249 summary => 'Update Twitter from BarnOwl', … … 238 266 usage => 'twitter-atreply USER [ACCOUNT]', 239 267 description => 'Send a Twitter @reply Message to USER on ACCOUNT (defaults to default_sender,' 240 . "or first service if no default is provided)" 241 } 242 ); 243 268 . "\nor first service if no default is provided)" 269 } 270 ); 271 272 BarnOwl::new_command( 'twitter-follow' => sub { cmd_twitter_follow(@_); }, 273 { 274 summary => 'Follow a user on Twitter', 275 usage => 'twitter-follow USER [ACCOUNT]', 276 description => 'Follow USER on Twitter ACCOUNT (defaults to default_sender, or first service' 277 . "\nif no default is provided)" 278 } 279 ); 280 281 BarnOwl::new_command( 'twitter-unfollow' => sub { cmd_twitter_unfollow(@_); }, 282 { 283 summary => 'Stop following a user on Twitter', 284 usage => 'twitter-unfollow USER [ACCOUNT]', 285 description => 'Stop following USER on Twitter ACCOUNT (defaults to default_sender, or first' 286 . "\nservice if no default is provided)" 287 } 288 ); 244 289 245 290 sub cmd_twitter { … … 270 315 my $account = shift; 271 316 BarnOwl::start_edit_win("Reply to \@" . $user . (defined $account ? " on $account" : ""), sub { twitter_atreply($account, $user, $id, shift) }); 317 } 318 319 sub cmd_twitter_follow { 320 my $cmd = shift; 321 my $user = shift; 322 die("Usage: $cmd USER\n") unless $user; 323 my $account = shift; 324 twitter_follow($account, $user); 325 } 326 327 sub cmd_twitter_unfollow { 328 my $cmd = shift; 329 my $user = shift; 330 die("Usage: $cmd USER\n") unless $user; 331 my $account = shift; 332 twitter_unfollow($account, $user); 272 333 } 273 334
Note: See TracChangeset
for help on using the changeset viewer.