Changeset 96dd574 for protocols/twitter/twitter.c
- Timestamp:
- 2012-11-25T13:11:19Z (11 years ago)
- Branches:
- master
- Children:
- 631ec80
- Parents:
- 2cd8540
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r2cd8540 r96dd574 4 4 * Simple module to facilitate twitter functionality. * 5 5 * * 6 * Copyright 2009 Geert Mulders <g.c.w.m.mulders@gmail.com>*6 * Copyright 2009-2010 Geert Mulders <g.c.w.m.mulders@gmail.com> * 7 7 * Copyright 2010-2012 Wilmer van der Gaast <wilmer@gaast.net> * 8 8 * * … … 30 30 #include "url.h" 31 31 32 #define twitter_msg( ic, fmt... ) \33 do { \34 struct twitter_data *td = ic->proto_data; \35 if( td->timeline_gc ) \36 imcb_chat_log( td->timeline_gc, fmt ); \37 else \38 imcb_log( ic, fmt ); \39 } while( 0 );40 41 32 GSList *twitter_connections = NULL; 42 43 33 /** 44 34 * Main loop function … … 245 235 return TRUE; 246 236 247 imcb_error(ic, "Maximum message length exceeded: %d > %d", len, max);237 twitter_log(ic, "Maximum message length exceeded: %d > %d", len, max); 248 238 249 239 return FALSE; … … 561 551 twitter_status_destroy(ic, id); 562 552 } else 563 twitter_ msg(ic, "Could not undo last action");553 twitter_log(ic, "Could not undo last action"); 564 554 565 555 g_free(cmds); … … 570 560 twitter_favourite_tweet(ic, id); 571 561 } else { 572 twitter_ msg(ic, "Please provide a message ID or username.");562 twitter_log(ic, "Please provide a message ID or username."); 573 563 } 574 564 g_free(cmds); … … 607 597 twitter_status_retweet(ic, id); 608 598 else 609 twitter_ msg(ic, "User `%s' does not exist or didn't "599 twitter_log(ic, "User `%s' does not exist or didn't " 610 600 "post any statuses recently", cmd[1]); 611 601 … … 638 628 639 629 if (!id || !bu) { 640 twitter_ msg(ic, "User `%s' does not exist or didn't "630 twitter_log(ic, "User `%s' does not exist or didn't " 641 631 "post any statuses recently", cmd[1]); 642 632 g_free(cmds); … … 684 674 g_free(cmds); 685 675 } 676 677 void twitter_log(struct im_connection *ic, char *format, ... ) 678 { 679 struct twitter_data *td = ic->proto_data; 680 va_list params; 681 char *text; 682 683 va_start(params, format); 684 text = g_strdup_vprintf(format, params); 685 va_end(params); 686 687 if (td->timeline_gc) 688 imcb_chat_log(td->timeline_gc, "%s", text); 689 else 690 imcb_log(ic, "%s", text); 691 692 g_free(text); 693 } 694 686 695 687 696 void twitter_initmodule()
Note: See TracChangeset
for help on using the changeset viewer.