diff options
author | Gary Kramlich <grim@reaperworld.com> | 2020-08-22 22:15:25 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2020-08-22 22:15:25 -0500 |
commit | 72e43eea90299b6262c0a50b4614a21d5800d4f3 (patch) | |
tree | 6a76c17addf0e1eafdd0853b261a3e1f186b8fa6 /libpurple/server.c | |
parent | 459b58ff8218ff93f075c8c60bd8dd56b4e6fac1 (diff) | |
download | pidgin-72e43eea90299b6262c0a50b4614a21d5800d4f3.tar.gz |
Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Move PurpleProtocolPrivacy to its own interface and make it match a typical GInterface implementation
Testing Done:
Compiled and ran with bonjour. Verified no errors in the output. Build and checked the docs as well.
Reviewed at https://reviews.imfreedom.org/r/80/
Diffstat (limited to 'libpurple/server.c')
-rw-r--r-- | libpurple/server.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libpurple/server.c b/libpurple/server.c index 040771e115..35fcd67cc3 100644 --- a/libpurple/server.c +++ b/libpurple/server.c @@ -35,6 +35,7 @@ #include "protocol.h" #include "purpleprivate.h" #include "purpleprotocolim.h" +#include "purpleprotocolprivacy.h" #include "request.h" #include "signals.h" #include "server.h" @@ -350,50 +351,49 @@ void purple_serv_move_buddy(PurpleBuddy *buddy, PurpleGroup *orig, PurpleGroup * void purple_serv_add_permit(PurpleConnection *gc, const char *name) { - PurpleProtocol *protocol; - if (gc) { - protocol = purple_connection_get_protocol(gc); - purple_protocol_privacy_iface_add_permit(protocol, gc, name); + PurpleProtocol *protocol = purple_connection_get_protocol(gc); + PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol); + + purple_protocol_privacy_add_permit(privacy, gc, name); } } void purple_serv_add_deny(PurpleConnection *gc, const char *name) { - PurpleProtocol *protocol; - if (gc) { - protocol = purple_connection_get_protocol(gc); - purple_protocol_privacy_iface_add_deny(protocol, gc, name); + PurpleProtocol *protocol = purple_connection_get_protocol(gc); + PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol); + + purple_protocol_privacy_add_deny(privacy, gc, name); } } -void purple_serv_rem_permit(PurpleConnection *gc, const char *name) +void purple_serv_remove_permit(PurpleConnection *gc, const char *name) { - PurpleProtocol *protocol; - if (gc) { - protocol = purple_connection_get_protocol(gc); - purple_protocol_privacy_iface_rem_permit(protocol, gc, name); + PurpleProtocol *protocol = purple_connection_get_protocol(gc); + PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol); + + purple_protocol_privacy_remove_permit(privacy, gc, name); } } -void purple_serv_rem_deny(PurpleConnection *gc, const char *name) +void purple_serv_remove_deny(PurpleConnection *gc, const char *name) { - PurpleProtocol *protocol; - if (gc) { - protocol = purple_connection_get_protocol(gc); - purple_protocol_privacy_iface_rem_deny(protocol, gc, name); + PurpleProtocol *protocol = purple_connection_get_protocol(gc); + PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol); + + purple_protocol_privacy_remove_deny(privacy, gc, name); } } void purple_serv_set_permit_deny(PurpleConnection *gc) { - PurpleProtocol *protocol; - if (gc) { - protocol = purple_connection_get_protocol(gc); + PurpleProtocol *protocol = purple_connection_get_protocol(gc); + PurpleProtocolPrivacy *privacy = PURPLE_PROTOCOL_PRIVACY(protocol); /* * this is called when either you import a buddy list, and make lots @@ -401,7 +401,7 @@ void purple_serv_set_permit_deny(PurpleConnection *gc) * in the prefs. In either case you should probably be resetting and * resending the permit/deny info when you get this. */ - purple_protocol_privacy_iface_set_permit_deny(protocol, gc); + purple_protocol_privacy_set_permit_deny(privacy, gc); } } |