libpurple/server.c

changeset 40521
c4269b37a13a
parent 40507
77d7bc9e5151
child 40541
9ceb8d25d4d9
equal deleted inserted replaced
40520:eae11ccb1bef 40521:c4269b37a13a
33 #include "notify.h" 33 #include "notify.h"
34 #include "prefs.h" 34 #include "prefs.h"
35 #include "protocol.h" 35 #include "protocol.h"
36 #include "purpleprivate.h" 36 #include "purpleprivate.h"
37 #include "purpleprotocolim.h" 37 #include "purpleprotocolim.h"
38 #include "purpleprotocolprivacy.h"
38 #include "request.h" 39 #include "request.h"
39 #include "signals.h" 40 #include "signals.h"
40 #include "server.h" 41 #include "server.h"
41 #include "status.h" 42 #include "status.h"
42 #include "util.h" 43 #include "util.h"
348 } 349 }
349 } 350 }
350 351
351 void purple_serv_add_permit(PurpleConnection *gc, const char *name) 352 void purple_serv_add_permit(PurpleConnection *gc, const char *name)
352 { 353 {
353 PurpleProtocol *protocol; 354 if (gc) {
354 355 PurpleProtocol *protocol = purple_connection_get_protocol(gc);
355 if (gc) { 356 PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol);
356 protocol = purple_connection_get_protocol(gc); 357
357 purple_protocol_privacy_iface_add_permit(protocol, gc, name); 358 purple_protocol_privacy_add_permit(privacy, gc, name);
358 } 359 }
359 } 360 }
360 361
361 void purple_serv_add_deny(PurpleConnection *gc, const char *name) 362 void purple_serv_add_deny(PurpleConnection *gc, const char *name)
362 { 363 {
363 PurpleProtocol *protocol; 364 if (gc) {
364 365 PurpleProtocol *protocol = purple_connection_get_protocol(gc);
365 if (gc) { 366 PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol);
366 protocol = purple_connection_get_protocol(gc); 367
367 purple_protocol_privacy_iface_add_deny(protocol, gc, name); 368 purple_protocol_privacy_add_deny(privacy, gc, name);
368 } 369 }
369 } 370 }
370 371
371 void purple_serv_rem_permit(PurpleConnection *gc, const char *name) 372 void purple_serv_remove_permit(PurpleConnection *gc, const char *name)
372 { 373 {
373 PurpleProtocol *protocol; 374 if (gc) {
374 375 PurpleProtocol *protocol = purple_connection_get_protocol(gc);
375 if (gc) { 376 PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol);
376 protocol = purple_connection_get_protocol(gc); 377
377 purple_protocol_privacy_iface_rem_permit(protocol, gc, name); 378 purple_protocol_privacy_remove_permit(privacy, gc, name);
378 } 379 }
379 } 380 }
380 381
381 void purple_serv_rem_deny(PurpleConnection *gc, const char *name) 382 void purple_serv_remove_deny(PurpleConnection *gc, const char *name)
382 { 383 {
383 PurpleProtocol *protocol; 384 if (gc) {
384 385 PurpleProtocol *protocol = purple_connection_get_protocol(gc);
385 if (gc) { 386 PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol);
386 protocol = purple_connection_get_protocol(gc); 387
387 purple_protocol_privacy_iface_rem_deny(protocol, gc, name); 388 purple_protocol_privacy_remove_deny(privacy, gc, name);
388 } 389 }
389 } 390 }
390 391
391 void purple_serv_set_permit_deny(PurpleConnection *gc) 392 void purple_serv_set_permit_deny(PurpleConnection *gc)
392 { 393 {
393 PurpleProtocol *protocol; 394 if (gc) {
394 395 PurpleProtocol *protocol = purple_connection_get_protocol(gc);
395 if (gc) { 396 PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol);
396 protocol = purple_connection_get_protocol(gc);
397 397
398 /* 398 /*
399 * this is called when either you import a buddy list, and make lots 399 * this is called when either you import a buddy list, and make lots
400 * of changes that way, or when the user toggles the permit/deny mode 400 * of changes that way, or when the user toggles the permit/deny mode
401 * in the prefs. In either case you should probably be resetting and 401 * in the prefs. In either case you should probably be resetting and
402 * resending the permit/deny info when you get this. 402 * resending the permit/deny info when you get this.
403 */ 403 */
404 purple_protocol_privacy_iface_set_permit_deny(protocol, gc); 404 purple_protocol_privacy_set_permit_deny(privacy, gc);
405 } 405 }
406 } 406 }
407 407
408 void purple_serv_join_chat(PurpleConnection *gc, GHashTable *data) 408 void purple_serv_join_chat(PurpleConnection *gc, GHashTable *data)
409 { 409 {

mercurial