Changes in protocols/twitter/twitter.c [f4b0911:9997691]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
rf4b0911 r9997691 66 66 67 67 68 static struct oauth_service twitter_oauth =68 static const struct oauth_service twitter_oauth = 69 69 { 70 70 "http://api.twitter.com/oauth/request_token", … … 115 115 else if( info->stage == OAUTH_ACCESS_TOKEN ) 116 116 { 117 if( info->token == NULL )117 if( info->token == NULL || info->token_secret == NULL ) 118 118 { 119 119 imcb_error( ic, "OAuth error: %s", info->http->status_string ); … … 144 144 } 145 145 146 static gboolean twitter_length_check( struct im_connection *ic, gchar *msg ) 147 { 148 int max = set_getint( &ic->acc->set, "message_length" ), len; 149 150 if( max == 0 || ( len = g_utf8_strlen( msg, -1 ) ) <= max ) 151 return TRUE; 152 153 imcb_error( ic, "Maximum message length exceeded: %d > %d", len, max ); 154 155 return FALSE; 156 } 157 146 158 static void twitter_init( account_t *acc ) 147 159 { 148 160 set_t *s; 161 162 s = set_add( &acc->set, "message_length", "140", set_eval_int, acc ); 149 163 150 164 s = set_add( &acc->set, "mode", "one", set_eval_mode, acc ); … … 231 245 } 232 246 } 233 else 247 else if( twitter_length_check(ic, message) ) 234 248 twitter_post_status(ic, message); 235 249 } … … 262 276 static void twitter_chat_msg( struct groupchat *c, char *message, int flags ) 263 277 { 264 if( c && message )278 if( c && message && twitter_length_check(c->ic, message)) 265 279 twitter_post_status(c->ic, message); 266 280 }
Note: See TracChangeset
for help on using the changeset viewer.