- Timestamp:
- 2009-10-07T23:37:32Z (15 years ago)
- Branches:
- master
- Children:
- e046390
- Parents:
- 389f7be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/purple/purple.c
r389f7be r0cbef26 129 129 { 130 130 /* TODO: Figure out variables to export via set. */ 131 131 132 } 132 133 … … 135 136 struct im_connection *ic = imcb_new( acc ); 136 137 PurpleAccount *pa; 137 PurpleSavedStatus *ps; 138 //PurpleSavedStatus *ps; 139 GList *i; 138 140 139 141 /* For now this is needed in the _connected() handlers if using … … 149 151 purple_account_set_enabled( pa, "BitlBee", TRUE ); 150 152 153 /* 154 for( i = ((PurplePluginProtocolInfo *)pa->gc->prpl->info->extra_info)->protocol_options; i; i = i->next ) 155 { 156 PurpleAccountOption *o = i->data; 157 158 printf( "%s\n", o->pref_name ); 159 } 160 */ 161 151 162 //ps = purple_savedstatus_new( NULL, PURPLE_STATUS_AVAILABLE ); 152 163 //purple_savedstatus_activate_for_account( ps, pa ); … … 170 181 171 182 purple_conv_im_send( purple_conversation_get_im_data( conv ), message ); 183 184 return 1; 172 185 } 173 186 … … 195 208 static int purple_send_typing( struct im_connection *ic, char *who, int typing ) 196 209 { 210 return 1; 197 211 } 198 212 … … 215 229 static void prplcb_conn_progress( PurpleConnection *gc, const char *text, size_t step, size_t step_count ) 216 230 { 217 imcb_log( purple_ic_by_gc( gc ), "%s", text ); 231 struct im_connection *ic = purple_ic_by_gc( gc ); 232 233 imcb_log( ic, "%s", text ); 218 234 } 219 235 … … 230 246 static void prplcb_conn_disconnected( PurpleConnection *gc ) 231 247 { 232 imc_logout( purple_ic_by_gc( gc ), TRUE ); 248 struct im_connection *ic = purple_ic_by_gc( gc ); 249 250 if( ic != NULL ) 251 imc_logout( ic, TRUE ); 233 252 } 234 253 235 254 static void prplcb_conn_notice( PurpleConnection *gc, const char *text ) 236 255 { 237 imcb_log( purple_ic_by_gc( gc ), "%s", text ); 256 struct im_connection *ic = purple_ic_by_gc( gc ); 257 258 if( ic != NULL ) 259 imcb_log( ic, "%s", text ); 238 260 } 239 261 240 262 static void prplcb_conn_report_disconnect_reason( PurpleConnection *gc, PurpleConnectionError reason, const char *text ) 241 263 { 264 struct im_connection *ic = purple_ic_by_gc( gc ); 265 242 266 /* PURPLE_CONNECTION_ERROR_NAME_IN_USE means concurrent login, 243 267 should probably handle that. */ 244 imcb_error( purple_ic_by_gc( gc ), "%s", text ); 268 if( ic != NULL ) 269 imcb_error( ic, "%s", text ); 245 270 } 246 271 … … 262 287 struct im_connection *ic = purple_ic_by_pa( bud->account ); 263 288 264 if( node->type == PURPLE_BLIST_BUDDY_NODE )289 if( node->type == PURPLE_BLIST_BUDDY_NODE && ic != NULL ) 265 290 { 266 291 imcb_add_buddy( ic, bud->name, NULL ); … … 273 298 { 274 299 PurpleBuddy *bud = (PurpleBuddy*) node; 275 276 if( node->type == PURPLE_BLIST_BUDDY_NODE ) 277 { 278 imcb_buddy_status( purple_ic_by_pa( bud->account ), bud->name, 300 struct im_connection *ic = purple_ic_by_pa( bud->account ); 301 302 if( node->type == PURPLE_BLIST_BUDDY_NODE && ic != NULL ) 303 { 304 imcb_buddy_status( ic, bud->name, 279 305 purple_presence_is_online( bud->presence ) ? OPT_LOGGED_IN : 0, 280 306 NULL, NULL ); … … 285 311 { 286 312 PurpleBuddy *bud = (PurpleBuddy*) node; 287 288 if( node->type == PURPLE_BLIST_BUDDY_NODE ) 289 imcb_remove_buddy( purple_ic_by_pa( bud->account ), bud->name, NULL ); 313 struct im_connection *ic = purple_ic_by_pa( bud->account ); 314 315 if( node->type == PURPLE_BLIST_BUDDY_NODE && ic != NULL ) 316 { 317 imcb_remove_buddy( ic, bud->name, NULL ); 318 } 290 319 } 291 320 … … 331 360 }; 332 361 362 static void prplcb_debug_print( PurpleDebugLevel level, const char *category, const char *arg_s ) 363 { 364 printf( "DEBUG %s: %s", category, arg_s ); 365 } 366 367 static PurpleDebugUiOps bee_debug_uiops = 368 { 369 prplcb_debug_print, 370 }; 371 333 372 static void purple_ui_init() 334 373 { … … 336 375 purple_connections_set_ui_ops( &bee_conn_uiops ); 337 376 purple_conversations_set_ui_ops( &bee_conv_uiops ); 377 //purple_debug_set_ui_ops( &bee_debug_uiops ); 338 378 } 339 379
Note: See TracChangeset
for help on using the changeset viewer.