--- a/libpurple/protocols/zephyr/zephyr.c Wed Jan 27 23:29:08 2021 -0600
+++ b/libpurple/protocols/zephyr/zephyr.c Fri Jan 29 06:54:08 2021 -0600
@@ -65,6 +65,7 @@
typedef gssize (*PollableInputStreamReadFunc)(GPollableInputStream *stream, void *bufcur, GError **error);
typedef gboolean (*ZephyrLoginFunc)(zephyr_account *zephyr);
typedef Code_t (*ZephyrSubscribeToFunc)(zephyr_account *zephyr, ZSubscription_t *sub);
+typedef gboolean (*ZephyrRequestLocationsFunc)(zephyr_account *zephyr, gchar *who); PURPLE_ZEPHYR_NONE, /* Non-kerberized ZEPH0.2 */
@@ -95,6 +96,7 @@
GInputStream *tzc_stdout;
ZephyrSubscribeToFunc subscribe_to;
+ ZephyrRequestLocationsFunc request_locations; @@ -843,28 +845,27 @@
-zephyr_request_locations(zephyr_account *zephyr, gchar *who)
+request_locations_tzc(zephyr_account *zephyr, gchar *who) - if (use_zeph02(zephyr)) {
- ZAsyncLocateData_t ald;
+ zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n", who); + result = zephyr_write_message(zephyr, zlocstr); - zerr = ZRequestLocations(who, &ald, UNACKED, ZAUTH);
- return zerr == ZERR_NONE;
+request_locations_zeph02(G_GNUC_UNUSED zephyr_account *zephyr, gchar *who) + ZAsyncLocateData_t ald;
- zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n", who);
- zephyr_write_message(zephyr, zlocstr);
+ zerr = ZRequestLocations(who, &ald, UNACKED, ZAUTH); + return zerr == ZERR_NONE; @@ -918,7 +919,7 @@
purple_debug_info("zephyr","chk: %s b->name %s\n",chk,name);
/* XXX add real error reporting */
/* doesn't matter if this fails or not; we'll just move on to the next one */
- zephyr_request_locations(zephyr, chk);
+ zephyr->request_locations(zephyr, chk); @@ -1416,11 +1417,13 @@
check_notify = check_notify_tzc;
zephyr->subscribe_to = subscribe_to_tzc;
+ zephyr->request_locations = request_locations_tzc; zephyr->connection_type = PURPLE_ZEPHYR_KRB4;
check_notify = check_notify_zeph02;
zephyr->subscribe_to = subscribe_to_zeph02;
+ zephyr->request_locations = request_locations_zeph02; zephyr->encoding = (char *)purple_account_get_string(account, "encoding", ZEPHYR_FALLBACK_CHARSET);
@@ -1850,9 +1853,9 @@
zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- gchar* normalized_who = local_zephyr_normalize(zephyr,who);
+ gchar *normalized_who = local_zephyr_normalize(zephyr, who); - if (zephyr_request_locations(zephyr, normalized_who)) {
+ if (zephyr->request_locations(zephyr, normalized_who)) { zephyr->pending_zloc_names = g_list_append(zephyr->pending_zloc_names, normalized_who);
/* XXX deal with errors somehow */