diff options
author | Gary Kramlich <grim@reaperworld.com> | 2020-12-03 04:34:04 -0600 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2020-12-03 04:34:04 -0600 |
commit | 93447975013300f34f9bb207a663670d52861f0f (patch) | |
tree | 7a5ff10eace6ba058dbc5e30836a125509ef0452 /libpurple/util.c | |
parent | 8fd8770e91d74c54a605e159581b47ce80a9f232 (diff) | |
download | pidgin-93447975013300f34f9bb207a663670d52861f0f.tar.gz |
Fix the PurpleProtocolClient interface and split it out to its own file.
Testing Done:
Compile and unit tests.
Reviewed at https://reviews.imfreedom.org/r/193/
Diffstat (limited to 'libpurple/util.c')
-rw-r--r-- | libpurple/util.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpurple/util.c b/libpurple/util.c index 12386ecd54..22d25ddee7 100644 --- a/libpurple/util.c +++ b/libpurple/util.c @@ -28,6 +28,7 @@ #include "notify.h" #include "protocol.h" #include "prefs.h" +#include "purpleprotocolclient.h" #include "util.h" #include <json-glib/json-glib.h> @@ -896,8 +897,9 @@ purple_normalize(PurpleAccount *account, const char *str) PurpleProtocol *protocol = purple_protocols_find(purple_account_get_protocol_id(account)); - if (protocol != NULL) - ret = purple_protocol_client_iface_normalize(protocol, account, str); + if(PURPLE_IS_PROTOCOL_CLIENT(protocol)) { + ret = purple_protocol_client_normalize(PURPLE_PROTOCOL_CLIENT(protocol), account, str); + } } if (ret == NULL) @@ -937,7 +939,7 @@ purple_normalize_nocase(const PurpleAccount *account, const char *str) } gboolean -purple_validate(const PurpleProtocol *protocol, const char *str) +purple_validate(PurpleProtocol *protocol, const char *str) { const char *normalized; @@ -950,8 +952,8 @@ purple_validate(const PurpleProtocol *protocol, const char *str) if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, normalize)) return TRUE; - normalized = purple_protocol_client_iface_normalize(PURPLE_PROTOCOL(protocol), - NULL, str); + normalized = purple_protocol_client_normalize(PURPLE_PROTOCOL_CLIENT(protocol), + NULL, str); return (NULL != normalized); } |