- Timestamp:
- 2015-01-17T20:13:19Z (10 years ago)
- Branches:
- master
- Children:
- e26aa72
- Parents:
- 1065dd4 (diff), 664bac3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee_chat.c
r1065dd4 reb4ad8d 85 85 bee_t *bee = ic->bee; 86 86 bee_user_t *bu; 87 gboolean temp; 87 88 char *s; 88 89 … … 92 93 93 94 bu = bee_user_by_handle( bee, ic, who ); 95 temp = ( bu == NULL ); 96 97 if( temp ) 98 bu = bee_user_new( bee, ic, who, BEE_USER_ONLINE ); 94 99 95 100 s = set_getstr( &ic->bee->set, "strip_html" ); … … 98 103 strip_html( msg ); 99 104 100 if( b u && bee->ui->chat_msg )105 if( bee->ui->chat_msg ) 101 106 bee->ui->chat_msg( bee, c, bu, msg, sent_at ); 102 else 103 imcb_chat_log( c, "Message from unknown participant %s: %s", who, msg ); 107 108 if( temp ) 109 bee_user_free( bee, bu ); 104 110 } 105 111 -
protocols/jabber/jabber_util.c
r1065dd4 reb4ad8d 330 330 } 331 331 332 /* Returns a new string. Don't leak it! */ 332 /* The /resource part is case sensitive. This stops once we see a slash. 333 Returns a new string. Don't leak it! */ 333 334 char *jabber_normalize( const char *orig ) 334 335 { 335 int len, i; 336 char *new; 337 338 len = strlen( orig ); 339 new = g_new( char, len + 1 ); 340 341 /* So it turns out the /resource part is case sensitive. Yeah, and 342 it's Unicode but feck Unicode. :-P So stop once we see a slash. */ 343 for( i = 0; i < len && orig[i] != '/' ; i ++ ) 344 new[i] = g_ascii_tolower( orig[i] ); 345 for( ; orig[i]; i ++ ) 346 new[i] = orig[i]; 347 348 new[i] = 0; 336 char *lower, *new, *s; 337 338 if ( ! ( s = strchr( orig, '/' ) ) ) 339 return g_utf8_strdown( orig, -1 ); 340 341 lower = g_utf8_strdown( orig, (s - orig) ); /* stop in s */ 342 new = g_strconcat( lower, s, NULL ); 343 g_free( lower ); 344 return new; 345 } 346 347 /* Similar to jabber_normalize, but works with addresses in the form 348 * resource=chatroom@example.com */ 349 char *jabber_normalize_ext( const char *orig ) 350 { 351 char *lower, *new, *s; 352 353 if ( ! ( s = strchr( orig, '=' ) ) ) 354 return g_utf8_strdown( orig, -1 ); 355 356 lower = g_utf8_strdown( s, -1 ); /* start in s */ 357 358 *s = 0; 359 new = g_strconcat( orig, lower, NULL ); 360 *s = '='; 361 362 g_free( lower ); 349 363 return new; 350 364 } … … 556 570 char *s, *jid; 557 571 558 jid = jabber_normalize ( jid_ );572 jid = jabber_normalize_ext( jid_ ); 559 573 560 574 if( ( s = strchr( jid, '=' ) ) == NULL ) -
protocols/msn/ns.c
r1065dd4 reb4ad8d 881 881 struct msn_buddy_data *bd = bu->data; 882 882 struct msn_data *md = bu->ic->proto_data; 883 char handle[strlen(bu->handle) ];883 char handle[strlen(bu->handle) + 1]; 884 884 char *domain; 885 885 char l[4]; -
protocols/oscar/conn.c
r1065dd4 reb4ad8d 571 571 572 572 if (FD_ISSET(conn->fd, &fds) || FD_ISSET(conn->fd, &wfds)) { 573 unsigned int len = sizeof(error);573 socklen_t len = sizeof(error); 574 574 575 575 if (getsockopt(conn->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) -
protocols/twitter/twitter.c
r1065dd4 reb4ad8d 51 51 struct twitter_data *td = ic->proto_data; 52 52 53 char *last_tweet = set_getstr(&ic->acc->set, "_last_tweet"); 54 if (last_tweet) 55 td->timeline_id = g_ascii_strtoull(last_tweet, NULL, 0); 56 53 57 /* Create the room now that we "logged in". */ 54 58 if (td->flags & TWITTER_MODE_CHAT) … … 327 331 s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc); 328 332 333 s = set_add(&acc->set, "_last_tweet", "0", NULL, acc); 334 s->flags |= SET_HIDDEN | SET_NOSAVE; 335 329 336 if (strcmp(acc->prpl->name, "twitter") == 0) { 330 337 s = set_add(&acc->set, "stream", "true", set_eval_bool, acc); -
protocols/twitter/twitter_lib.c
r1065dd4 reb4ad8d 234 234 void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor) 235 235 { 236 // Primitive, but hey! It works... 236 // Primitive, but hey! It works... 237 237 char *args[2]; 238 238 args[0] = "cursor"; 239 args[1] = g_strdup_printf("% lld", (long long)next_cursor);239 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 240 240 twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2); 241 241 … … 721 721 { 722 722 struct twitter_data *td = ic->proto_data; 723 char *last_id_str; 723 724 724 725 if (status->user == NULL || status->text == NULL) … … 738 739 // we won't pick up the updates already in the list. 739 740 td->timeline_id = MAX(td->timeline_id, status->rt_id); 741 742 last_id_str = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 743 set_setstr(&ic->acc->set, "last_tweet", last_id_str); 744 g_free(last_id_str); 740 745 } 741 746 … … 997 1002 char *args[6]; 998 1003 args[0] = "cursor"; 999 args[1] = g_strdup_printf("% lld", (long long)next_cursor);1004 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 1000 1005 args[2] = "include_entities"; 1001 1006 args[3] = "true"; 1002 1007 if (td->timeline_id) { 1003 1008 args[4] = "since_id"; 1004 args[5] = g_strdup_printf("% llu", (long long unsigned int)td->timeline_id);1009 args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 1005 1010 } 1006 1011 … … 1033 1038 char *args[6]; 1034 1039 args[0] = "cursor"; 1035 args[1] = g_strdup_printf("% lld", (long long)next_cursor);1040 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 1036 1041 args[2] = "include_entities"; 1037 1042 args[3] = "true"; 1038 1043 if (td->timeline_id) { 1039 1044 args[4] = "since_id"; 1040 args[5] = g_strdup_printf("% llu", (long long unsigned int)td->timeline_id);1045 args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 1041 1046 } else { 1042 1047 args[4] = "count"; … … 1167 1172 "status", msg, 1168 1173 "in_reply_to_status_id", 1169 g_strdup_printf("% llu", (unsigned long long)in_reply_to)1174 g_strdup_printf("%" G_GUINT64_FORMAT, in_reply_to) 1170 1175 }; 1171 1176 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, … … 1201 1206 { 1202 1207 char *url; 1203 url = g_strdup_printf("%s% llu%s", TWITTER_STATUS_DESTROY_URL,1204 (unsigned long long)id, ".json");1208 url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s", 1209 TWITTER_STATUS_DESTROY_URL, id, ".json"); 1205 1210 twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0, 1206 1211 TWITTER_HTTP_USER_ACK); … … 1211 1216 { 1212 1217 char *url; 1213 url = g_strdup_printf("%s% llu%s", TWITTER_STATUS_RETWEET_URL,1214 (unsigned long long)id, ".json");1218 url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s", 1219 TWITTER_STATUS_RETWEET_URL, id, ".json"); 1215 1220 twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0, 1216 1221 TWITTER_HTTP_USER_ACK); … … 1241 1246 NULL, 1242 1247 }; 1243 args[1] = g_strdup_printf("% llu", (unsigned long long)id);1248 args[1] = g_strdup_printf("%" G_GUINT64_FORMAT, id); 1244 1249 twitter_http_f(ic, TWITTER_FAVORITE_CREATE_URL, twitter_http_post, 1245 1250 ic, 1, args, 2, TWITTER_HTTP_USER_ACK); -
protocols/yahoo/libyahoo2.c
r1065dd4 reb4ad8d 974 974 msg = pair->value; 975 975 976 if (pair->key == 13) ; 976 if (pair->key == 13) 977 ; 977 978 if (pair->key == 16) /* error */ 978 979 msg = pair->value; … … 1795 1796 switch (code) 1796 1797 { 1797 case 1212: return YAHOO_LOGIN_PASSWD;1798 case 1213: return YAHOO_LOGIN_LOCK;1799 case 1235: return YAHOO_LOGIN_UNAME;1798 case 1212: return (enum yahoo_status) YAHOO_LOGIN_PASSWD; 1799 case 1213: return (enum yahoo_status) YAHOO_LOGIN_LOCK; 1800 case 1235: return (enum yahoo_status) YAHOO_LOGIN_UNAME; 1800 1801 default: return (enum yahoo_status) code; 1801 1802 } … … 3610 3611 yd = yid->yd; 3611 3612 3612 pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE,3613 pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, (enum ypacket_status) YAHOO_STATUS_OFFLINE, 3613 3614 yd->session_id); 3614 3615 … … 3677 3678 if (yd->current_status == YAHOO_STATUS_INVISIBLE) { 3678 3679 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE, 3679 YAHOO_STATUS_AVAILABLE, 0);3680 (enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0); 3680 3681 yahoo_packet_hash(pkt, 13, "2"); 3681 3682 yahoo_send_packet(yid, pkt, 0); … … 3696 3697 if (old_status == YAHOO_STATUS_INVISIBLE) { 3697 3698 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE, 3698 YAHOO_STATUS_AVAILABLE, 0);3699 (enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0); 3699 3700 yahoo_packet_hash(pkt, 13, "1"); 3700 3701 yahoo_send_packet(yid, pkt, 0); -
protocols/yahoo/yahoo_util.h
r1065dd4 reb4ad8d 48 48 49 49 # define snprintf g_snprintf 50 #ifdef vsnprintf 51 #undef vsnprintf 52 #endif 50 53 # define vsnprintf g_vsnprintf 51 54
Note: See TracChangeset
for help on using the changeset viewer.