Remove the Zephyr protocol plugin
A lot of work has gone into trying to keep this protocol plugin alive, but after
much deliberation it's time to remove it.
I reached out on Twitter awhile ago to see if anyone used it and no one
responded.
As such, it's time to let it go.
Testing Done:
ran `meson --wipe` then did a full build and `ninja pidgin-pot`
Reviewed at https://reviews.imfreedom.org/r/1971/
--- a/libpurple/protocols/meson.build Wed Oct 26 01:22:53 2022 -0500
+++ b/libpurple/protocols/meson.build Wed Oct 26 01:39:49 2022 -0500
@@ -7,4 +7,3 @@
--- a/libpurple/protocols/zephyr/ZAsyncLocate.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for asynchronous location functions.
- * Created by: Marc Horowitz
- * Copyright (c) 1990,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZRequestLocations(const char *user, ZAsyncLocateData_t *zald,
- ZNotice_Kind_t kind, /* UNSAFE, UNACKED, or ACKED */
- size_t userlen, versionlen;
- if (ZGetSocket() == NULL) {
- retval = ZOpenPort(NULL);
- if (retval != ZERR_NONE) {
- (void) memset((char *)¬ice, 0, sizeof(notice));
- notice.z_port = __Zephyr_port;
- notice.z_class = LOCATE_CLASS;
- notice.z_class_inst = user;
- notice.z_opcode = LOCATE_LOCATE;
- notice.z_recipient = "";
- notice.z_default_format = "";
- notice.z_message_len = 0;
- if ((retval = ZSendNotice(¬ice, auth)) != ZERR_NONE)
- userlen = strlen(user) + 1;
- versionlen = strlen(notice.z_version) + 1;
- if ((zald->user = (char *) malloc(userlen)) == NULL) {
- if ((zald->version = (char *) malloc(versionlen)) == NULL) {
- zald->uid = notice.z_multiuid;
- g_strlcpy(zald->user,user,userlen);
- g_strlcpy(zald->version,notice.z_version,versionlen);
-ZParseLocations(ZNotice_t *notice, ZAsyncLocateData_t *zald, int *nlocs,
- ZFlushLocations(); /* This never fails (this function is part of the
- library, so it is allowed to know this). */
- /* non-matching protocol version numbers means the
- server is probably an older version--must punt */
- if (zald && !purple_strequal(notice->z_version, zald->version))
- if (notice->z_kind == SERVNAK)
- /* flag ACKs as special */
- if (notice->z_kind == SERVACK &&
- purple_strequal(notice->z_opcode, LOCATE_LOCATE)) {
- if (notice->z_kind != ACKED)
- return (ZERR_INTERNAL);
- end = notice->z_message+notice->z_message_len;
- for (ptr=notice->z_message;ptr<end;ptr++)
- __locate_list = (ZLocations_t *)malloc((unsigned)__locate_num*
- for (ptr=notice->z_message, i=0; i<__locate_num; i++) {
- len = strlen (ptr) + 1;
- __locate_list[i].host = (char *) malloc(len);
- if (!__locate_list[i].host)
- g_strlcpy(__locate_list[i].host, ptr,len);
- len = strlen (ptr) + 1;
- __locate_list[i].time = (char *) malloc(len);
- if (!__locate_list[i].time)
- g_strlcpy(__locate_list[i].time, ptr,len);
- len = strlen (ptr) + 1;
- __locate_list[i].tty = (char *) malloc(len);
- if (!__locate_list[i].tty)
- g_strlcpy(__locate_list[i].tty, ptr,len);
- len = strlen(zald->user) + 1;
- if ((*user = (char *) malloc(len)) == NULL)
- g_strlcpy(*user,zald->user,len);
- len = strlen(notice->z_class_inst) + 1;
- if ((*user = (char *) malloc(len)) == NULL)
- g_strlcpy(*user,notice->z_class_inst,len);
-ZCompareALDPred(ZNotice_t *notice, void *zald)
- return(ZCompareUID(&(notice->z_multiuid),
- &(((ZAsyncLocateData_t *) zald)->uid)));
-ZFreeALD(ZAsyncLocateData_t *zald)
- (void) memset(zald, 0, sizeof(*zald));
--- a/libpurple/protocols/zephyr/ZCkAuth.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZCheckAuthentication function.
- * Created by: Robert French
- * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-/* Check authentication of the notice.
- If it looks authentic but fails the Kerberos check, return -1.
- If it looks authentic and passes the Kerberos check, return 1.
- If it doesn't look authentic, return 0
- When not using Kerberos, return true if the notice claims to be authentic.
-ZCheckAuthentication(ZNotice_t *notice)
-#ifdef ZEPHYR_USES_KERBEROS
- ZChecksum_t our_checksum;
- /* If the value is already known, return it. */
- if (notice->z_checked_auth != ZAUTH_UNSET)
- return (notice->z_checked_auth);
- if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
- __Zephyr_realm, &cred)) != 0)
- our_checksum = des_quad_cksum(notice->z_packet, NULL,
- notice->z_default_format+
- strlen(notice->z_default_format)+1-
- notice->z_packet, 0, (C_Block *)cred.session);
- /* if mismatched checksum, then the packet was corrupted */
- return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
- return (notice->z_auth ? ZAUTH_YES : ZAUTH_NO);
--- a/libpurple/protocols/zephyr/ZCkIfNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZCheckIfNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZCheckIfNotice(ZNotice_t *notice, GSocketAddress **from,
- register int (*predicate)(ZNotice_t *, void *), void *args)
- register Z_InputQ *qptr;
- if ((retval = Z_ReadEnqueue()) != ZERR_NONE)
- qptr = Z_GetFirstComplete();
- if ((retval = ZParseNotice(qptr->packet, qptr->packet_len,
- &tmpnotice)) != ZERR_NONE)
- if ((*predicate)(&tmpnotice, args)) {
- if (!(buffer = (char *) malloc((unsigned) qptr->packet_len)))
- (void) memcpy(buffer, qptr->packet, qptr->packet_len);
- *from = g_object_ref(qptr->from);
- if ((retval = ZParseNotice(buffer, qptr->packet_len,
- notice)) != ZERR_NONE) {
- qptr = Z_GetNextComplete(qptr);
- return (ZERR_NONOTICE);
--- a/libpurple/protocols/zephyr/ZClosePort.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZClosePort function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- g_clear_object(&__Zephyr_socket);
--- a/libpurple/protocols/zephyr/ZCmpUID.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZCompareUID function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZCompareUID(ZUnique_Id_t *uid1, ZUnique_Id_t *uid2)
- return (!memcmp((char *)uid1, (char *)uid2, sizeof (*uid1)));
--- a/libpurple/protocols/zephyr/ZCmpUIDP.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZCompareUIDPred function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZCompareUIDPred(ZNotice_t *notice, void *uid)
- return (ZCompareUID(¬ice->z_uid, (ZUnique_Id_t *) uid));
-ZCompareMultiUIDPred(ZNotice_t *notice, void *uid)
- return (ZCompareUID(¬ice->z_multiuid, (ZUnique_Id_t *) uid));
--- a/libpurple/protocols/zephyr/ZFlsLocs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFlushLocations function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- for (i=0;i<__locate_num;i++) {
- free(__locate_list[i].host);
- free(__locate_list[i].time);
- free(__locate_list[i].tty);
- free((char *)__locate_list);
--- a/libpurple/protocols/zephyr/ZFlsSubs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFlushSubscriptions function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFlushSubscriptions(void)
- if (!__subscriptions_list)
- for (i=0;i<__subscriptions_num;i++) {
- free(__subscriptions_list[i].zsub_class);
- free(__subscriptions_list[i].zsub_classinst);
- free(__subscriptions_list[i].zsub_recipient);
- free((char *)__subscriptions_list);
- __subscriptions_list = NULL;
- __subscriptions_num = 0;
--- a/libpurple/protocols/zephyr/ZFmtAuth.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatAuthenticNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#ifdef ZEPHYR_USES_KERBEROS
-ZFormatAuthenticNotice(ZNotice_t *notice, register char *buffer,
- register int buffer_len, int *len, C_Block session)
- newnotice.z_authent_len = 0;
- newnotice.z_ascii_authent = "";
- if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
- &hdrlen, &ptr, NULL)) != ZERR_NONE)
- newnotice.z_checksum = 0;
- (ZChecksum_t)des_quad_cksum(buffer, NULL, ptr - buffer, 0, (C_Block*)session);
- if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
- &hdrlen, NULL, NULL)) != ZERR_NONE)
- if (newnotice.z_message_len+hdrlen > buffer_len)
- (void) memcpy(ptr, newnotice.z_message, newnotice.z_message_len);
- *len = hdrlen+newnotice.z_message_len;
- if (*len > Z_MAXPKTLEN)
--- a/libpurple/protocols/zephyr/ZFmtList.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatNoticeList function.
- * Created by: Robert French
- * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFormatNoticeList(ZNotice_t *notice, register char **list, int nitems,
- char **buffer, int *ret_len, Z_AuthProc cert_routine)
- char header[Z_MAXHEADERLEN];
- if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
- cert_routine)) != ZERR_NONE)
- size += strlen(list[i])+1;
- *ret_len = hdrlen+size;
- /* *ret_len can never be zero here, no need to worry about malloc(0). */
- if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
- (void) memcpy(*buffer, header, hdrlen);
- for (;nitems;nitems--, list++) {
- (void) memcpy(ptr, *list, i);
--- a/libpurple/protocols/zephyr/ZFmtNotice.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFormatNotice(register ZNotice_t *notice, char **buffer, int *ret_len,
- Z_AuthProc cert_routine)
- char header[Z_MAXHEADERLEN];
- if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
- cert_routine)) != ZERR_NONE)
- *ret_len = hdrlen+notice->z_message_len;
- /* Length can never be zero, don't have to worry about malloc(0). */
- if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
- (void) memcpy(*buffer, header, hdrlen);
- (void) memcpy(*buffer+hdrlen, notice->z_message, notice->z_message_len);
--- a/libpurple/protocols/zephyr/ZFmtRaw.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatRawNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFormatRawNotice(register ZNotice_t *notice, char **buffer, int *ret_len)
- char header[Z_MAXHEADERLEN];
- if ((retval = Z_FormatRawHeader(notice, header, sizeof(header),
- &hdrlen, NULL, NULL)) != ZERR_NONE)
- *ret_len = hdrlen+notice->z_message_len;
- /* *ret_len is never 0, don't have to worry about malloc(0) */
- if (!(*buffer = (char *) malloc((unsigned) *ret_len)))
- (void) memcpy(*buffer, header, hdrlen);
- (void) memcpy(*buffer+hdrlen, notice->z_message, notice->z_message_len);
--- a/libpurple/protocols/zephyr/ZFmtRawLst.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatRawNoticeList function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems, char **buffer,
- char header[Z_MAXHEADERLEN];
- if ((retval = Z_FormatRawHeader(notice, header, sizeof(header),
- &hdrlen, NULL, NULL)) != ZERR_NONE)
- size += strlen(list[i])+1;
- *ret_len = hdrlen+size;
- if (!(*buffer = (char *) malloc((unsigned) *ret_len)))
- (void) memcpy(*buffer, header, hdrlen);
- for (;nitems;nitems--, list++) {
- (void) memcpy(ptr, *list, i);
--- a/libpurple/protocols/zephyr/ZFmtSmRaw.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatSmallRawNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFormatSmallRawNotice(ZNotice_t *notice, ZPacket_t buffer, int *ret_len)
- if ((retval = Z_FormatRawHeader(notice, buffer, Z_MAXHEADERLEN,
- &hdrlen, NULL, NULL)) != ZERR_NONE)
- *ret_len = hdrlen+notice->z_message_len;
- if (*ret_len > Z_MAXPKTLEN)
- (void) memcpy(buffer+hdrlen, notice->z_message, notice->z_message_len);
--- a/libpurple/protocols/zephyr/ZFreeNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFreeNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZFreeNotice(ZNotice_t *notice)
- free(notice->z_packet);
--- a/libpurple/protocols/zephyr/ZGetLocs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZGetLocations function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZGetLocations(ZLocations_t *location, int *numlocs)
- return (ZERR_NOLOCATIONS);
- if (__locate_next == __locate_num) {
- return (ZERR_NOMORELOCS);
- for (i = 0; i < MIN(*numlocs, __locate_num - __locate_next); i++) {
- location[i] = __locate_list[i + __locate_next];
- if (__locate_num - __locate_next < *numlocs) {
- *numlocs = __locate_num - __locate_next;
- __locate_next += *numlocs;
--- a/libpurple/protocols/zephyr/ZGetSender.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZGetSender.c function.
- * Created by: Robert French
- * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#ifdef ZEPHYR_USES_KERBEROS
- static char sender[ANAME_SZ+INST_SZ+REALM_SZ+3] = "";
- static char sender[128] = "";
- unsigned long sender_size = sizeof(sender) - 1;
-#ifdef ZEPHYR_USES_KERBEROS
- if ((kerror = krb_get_tf_fullname((char *)TKT_FILE, pname, pinst, prealm)) == KSUCCESS)
- sprintf(sender, "%s%s%s@%s", pname, (pinst[0] ? "." : ""), pinst, prealm);
- GetUserName(sender, &sender_size);
- /* XXX a uid_t is a u_short (now), but getpwuid
- * wants an int. AARGH! */
- pw = getpwuid((int) getuid());
- sprintf(sender, "%s@%s", pw->pw_name, __Zephyr_realm);
--- a/libpurple/protocols/zephyr/ZGetSubs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZGetSubscriptions function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZGetSubscriptions(ZSubscription_t *subscription, int *numsubs)
- if (!__subscriptions_list) {
- return (ZERR_NOSUBSCRIPTIONS);
- if (__subscriptions_next == __subscriptions_num) {
- return (ZERR_NOMORESUBSCRIPTIONS);
- for (i = 0; i < MIN(*numsubs, __subscriptions_num - __subscriptions_next);
- subscription[i] = __subscriptions_list[i + __subscriptions_next];
- if (__subscriptions_num - __subscriptions_next < *numsubs) {
- *numsubs = __subscriptions_num - __subscriptions_next;
- __subscriptions_next += *numsubs;
--- a/libpurple/protocols/zephyr/ZGetWGPort.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZGetWGPort function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- char *envptr, name[128];
- long int buffsize= 128;
- char tempdir[buffsize];
- envptr = getenv("WGFILE");
- GetTempPath(buffsize,tempdir);
- GetTempFileName(tempdir,"wg.",0,name);
- (void) sprintf(name, "/tmp/wg.%d", getuid());
- if (!(fp = fopen(envptr, "r")))
- /* if fscanf fails, return -1 via wgport */
- if (fscanf(fp, "%d", &wgport) != 1)
--- a/libpurple/protocols/zephyr/ZIfNotice.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZIfNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZIfNotice(ZNotice_t *notice, GSocketAddress **from,
- int (*predicate)(ZNotice_t *, void *), void *args)
- if ((retval = Z_WaitForComplete()) != ZERR_NONE)
- qptr = Z_GetFirstComplete();
- if ((retval = ZParseNotice(qptr->packet, qptr->packet_len,
- &tmpnotice)) != ZERR_NONE)
- if ((*predicate)(&tmpnotice, args)) {
- if (!(buffer = (char *) malloc((unsigned) qptr->packet_len)))
- (void) memcpy(buffer, qptr->packet, qptr->packet_len);
- *from = g_object_ref(qptr->from);
- if ((retval = ZParseNotice(buffer, qptr->packet_len,
- notice)) != ZERR_NONE) {
- qptr = Z_GetNextComplete(qptr);
- if ((retval = Z_ReadWait()) != ZERR_NONE)
- qptr = Z_GetFirstComplete(); /* need to look over all of
- the queued messages, in case
- a fragment has been reassembled */
--- a/libpurple/protocols/zephyr/ZInit.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZInitialize function.
- * Created by: Robert French
- * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#ifdef ZEPHYR_USES_KERBEROS
-#define INADDR_NONE 0xffffffff
- struct servent *hmserv;
- GResolver *resolver = NULL;
-#ifdef ZEPHYR_USES_KERBEROS
- gchar d1[ANAME_SZ], d2[INST_SZ];
- g_clear_object(&__HM_addr);
- hmserv = (struct servent *)getservbyname(HM_SVCNAME, "udp");
- port = hmserv ? hmserv->s_port : HM_SVC_FALLBACK;
- /* Set up local loopback address for HostManager */
- __HM_addr = g_inet_socket_address_new_from_string("127.0.0.1", port);
- /* Initialize the input queue */
- g_queue_init(&Z_input_queue);
- /* If there is no zhm, the code will fall back to something which might
- * not be "right", but this is is ok, since none of the servers call
- servaddr = INADDR_NONE;
- if ((code = ZOpenPort(NULL)) != ZERR_NONE) {
- if ((code = ZhmStat(¬ice)) != ZERR_NONE) {
- /* the first field, which is NUL-terminated, is the server name.
- If this code ever support a multiplexing zhm, this will have to
- be made smarter, and probably per-message */
-#ifdef ZEPHYR_USES_KERBEROS
- krealm = krb_realmofhost(notice.z_message);
- resolver = g_resolver_get_default();
- hosts = g_resolver_lookup_by_name(resolver, notice.z_message, NULL, NULL);
- GInetAddress *host_addr = hosts->data;
- if (g_inet_address_get_family(host_addr) == G_SOCKET_FAMILY_IPV4) {
- memcpy(&servaddr, g_inet_address_to_bytes(host_addr),
- g_list_free_full(hosts, g_object_unref);
- g_object_unref(host_addr);
- hosts = g_list_delete_link(hosts, hosts);
-#ifdef ZEPHYR_USES_KERBEROS
- g_strlcpy(__Zephyr_realm, krealm, REALM_SZ);
- } else if ((krb_get_tf_fullname(TKT_FILE, d1, d2, __Zephyr_realm) !=
- ((krbval = krb_get_lrealm(__Zephyr_realm, 1)) != KSUCCESS)) {
- g_object_unref(resolver);
- g_strlcpy(__Zephyr_realm, "local-realm", REALM_SZ);
- __My_addr = INADDR_NONE;
- if (servaddr != INADDR_NONE) {
- /* Try to get the local interface address by connecting a UDP
- * socket to the server address and getting the local address.
- * Some broken operating systems (e.g. Solaris 2.0-2.5) yield
- * INADDR_ANY (zero), so we have to check for that. */
- GSocket *s = g_socket_new(G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM,
- G_SOCKET_PROTOCOL_DEFAULT, NULL);
- GSocketAddress *remote_addr = NULL;
- GInetAddress *inet_addr = NULL;
- inet_addr = g_inet_address_new_from_bytes((const guint8 *)&servaddr,
- g_inet_socket_address_new(inet_addr, HM_SRV_SVC_FALLBACK);
- g_object_unref(inet_addr);
- if (g_socket_connect(s, remote_addr, NULL, NULL)) {
- GSocketAddress *local_addr =
- g_socket_get_local_address(s, NULL);
- inet_addr = g_inet_socket_address_get_address(
- G_INET_SOCKET_ADDRESS(local_addr));
- memcpy(&__My_addr, g_inet_address_to_bytes(inet_addr),
- g_object_unref(inet_addr);
- g_object_unref(local_addr);
- g_object_unref(remote_addr);
- if (__My_addr == INADDR_NONE) {
- /* We couldn't figure out the local interface address by the
- * above method. Try by resolving the local hostname. (This
- * is a pretty broken thing to do, and unfortunately what we
- * always do on server machines.) */
- const gchar *hostname = g_get_host_name();
- hosts = g_resolver_lookup_by_name(resolver, hostname, NULL, NULL);
- GInetAddress *host_addr = hosts->data;
- if (g_inet_address_get_family(host_addr) == G_SOCKET_FAMILY_IPV4) {
- memcpy(&servaddr, g_inet_address_to_bytes(host_addr),
- g_list_free_full(hosts, g_object_unref);
- g_object_unref(host_addr);
- hosts = g_list_delete_link(hosts, hosts);
- /* If the above methods failed, zero out __My_addr so things will sort
- if (__My_addr == INADDR_NONE) {
- g_object_unref(resolver);
- /* Get the sender so we can cache it */
--- a/libpurple/protocols/zephyr/ZLocations.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSetLocation, ZUnsetLocation, and
- * ZFlushMyLocations functions.
- * Created by: Robert French
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZSetLocation(char *exposure)
- return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH,
- "$sender logged in to $1 on $3 at $2"));
- return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH,
- "$sender logged out of $1 on $3 at $2"));
- return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, ""));
-static char host[MAXHOSTNAMELEN];
-static char *mytty = NULL;
-Z_SendLocation(char *class, char *opcode, Z_AuthProc auth, char *format)
- ZNotice_t notice, retnotice;
-#ifndef X_DISPLAY_MISSING
- short wg_port = ZGetWGPort();
- (void) memset((char *)¬ice, 0, sizeof(notice));
- notice.z_port = (unsigned short) ((wg_port == -1) ? 0 : wg_port);
- notice.z_class = class;
- notice.z_class_inst = ZGetSender();
- notice.z_opcode = opcode;
- notice.z_recipient = "";
- notice.z_num_other_fields = 0;
- notice.z_default_format = format;
- keep track of what we said before so that we can be consistent
- when changing location information.
- This is done mainly for the sake of the WindowGram client.
- hent = gethostbyname(g_get_host_name());
- (void) strncpy(host, hent->h_name, sizeof(host));
- host[sizeof(host) - 1] = '\0';
-#ifndef X_DISPLAY_MISSING
- if ((display = getenv("DISPLAY")) && *display) {
- mytty = g_strdup(display);
- mytty = g_strdup("WinPurple");
- p = strchr(ttyp + 1, '/');
- mytty = g_strdup((p) ? p + 1 : ttyp);
- mytty = g_strdup("unknown");
-#ifndef X_DISPLAY_MISSING
- ourtime = time((time_t *)0);
- bptr[1] = ctime(&ourtime);
- bptr[1][strlen(bptr[1])-1] = '\0';
- if ((retval = ZSendList(¬ice, bptr, 3, auth)) != ZERR_NONE)
- retval = Z_WaitForNotice (&retnotice, ZCompareUIDPred, ¬ice.z_uid,
- if (retval != ZERR_NONE)
- if (retnotice.z_kind == SERVNAK) {
- if (!retnotice.z_message_len) {
- ZFreeNotice(&retnotice);
- if (purple_strequal(retnotice.z_message, ZSRVACK_NOTSENT)) {
- ZFreeNotice(&retnotice);
- return (ZERR_AUTHFAIL);
- if (purple_strequal(retnotice.z_message, ZSRVACK_FAIL)) {
- ZFreeNotice(&retnotice);
- return (ZERR_LOGINFAIL);
- ZFreeNotice(&retnotice);
- if (retnotice.z_kind != SERVACK) {
- ZFreeNotice(&retnotice);
- return (ZERR_INTERNAL);
- if (!retnotice.z_message_len) {
- ZFreeNotice(&retnotice);
- return (ZERR_INTERNAL);
- if (!purple_strequal(retnotice.z_message, ZSRVACK_SENT) &&
- !purple_strequal(retnotice.z_message, ZSRVACK_NOTSENT)) {
- ZFreeNotice(&retnotice);
- return (ZERR_INTERNAL);
- ZFreeNotice(&retnotice);
--- a/libpurple/protocols/zephyr/ZMakeAscii.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZMakeAscii function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-static char *itox_chars = "0123456789ABCDEF";
-ZMakeAscii(register char *ptr, int len, unsigned char *field, int num)
- /* we need to add "0x" if we are between 4 byte pieces */
- /* except at the beginning, put a space in before the "0x" */
- *ptr++ = itox_chars[(int) (field[i] >> 4)];
- *ptr++ = itox_chars[(int) (field[i] & 0xf)];
-ZMakeAscii32(register char *ptr, int len, unsigned long value)
- *ptr++ = itox_chars[(value >> 28) & 0xf];
- *ptr++ = itox_chars[(value >> 24) & 0xf];
- *ptr++ = itox_chars[(value >> 20) & 0xf];
- *ptr++ = itox_chars[(value >> 16) & 0xf];
- *ptr++ = itox_chars[(value >> 12) & 0xf];
- *ptr++ = itox_chars[(value >> 8) & 0xf];
- *ptr++ = itox_chars[(value >> 4) & 0xf];
- *ptr++ = itox_chars[(value >> 0) & 0xf];
-ZMakeAscii16(register char *ptr, int len, unsigned int value)
- *ptr++ = itox_chars[(value >> 12) & 0xf];
- *ptr++ = itox_chars[(value >> 8) & 0xf];
- *ptr++ = itox_chars[(value >> 4) & 0xf];
- *ptr++ = itox_chars[(value >> 0) & 0xf];
--- a/libpurple/protocols/zephyr/ZMkAuth.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZMakeAuthentication function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#ifndef ERROR_TABLE_BASE_krb
-#define ERROR_TABLE_BASE_krb (39525376L)
-#ifdef ZEPHYR_USES_KERBEROS
-static long last_authent_time = 0L;
-static KTEXT_ST last_authent;
-ZMakeAuthentication(register ZNotice_t *notice, char *buffer, int buffer_len,
-#ifdef ZEPHYR_USES_KERBEROS
- extern unsigned long des_quad_cksum();
- if (last_authent_time == 0 || (now - last_authent_time > 120)) {
- result = krb_mk_req(&authent, SERVER_SERVICE,
- SERVER_INSTANCE, __Zephyr_realm, 0);
- if (result != MK_AP_OK) {
- return (result+ERROR_TABLE_BASE_krb);
- last_authent_time = now;
- last_authent = authent;
- authent = last_authent;
- notice->z_authent_len = authent.length;
- notice->z_ascii_authent = (char *)malloc((unsigned)authent.length*3);
- /* zero length authent is an error, so malloc(0) is not a problem */
- if (!notice->z_ascii_authent)
- if ((result = ZMakeAscii(notice->z_ascii_authent,
- authent.length)) != ZERR_NONE) {
- free(notice->z_ascii_authent);
- result = Z_FormatRawHeader(notice, buffer, buffer_len, len, &cstart,
- free(notice->z_ascii_authent);
- notice->z_authent_len = 0;
- /* Compute a checksum over the header and message. */
- if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
- __Zephyr_realm, &cred)) != 0)
- checksum = des_quad_cksum(buffer, NULL, cstart - buffer, 0, (C_Block *)cred.session);
- checksum ^= des_quad_cksum(cend, NULL, buffer + *len - cend, 0,
- (C_Block *)cred.session);
- checksum ^= des_quad_cksum(notice->z_message, NULL, notice->z_message_len,
- 0, (C_Block *)cred.session);
- notice->z_checksum = checksum;
- ZMakeAscii32(cstart, buffer + buffer_len - cstart, checksum);
- notice->z_checksum = 0;
- notice->z_authent_len = 0;
- notice->z_ascii_authent = "";
- return (Z_FormatRawHeader(notice, buffer, buffer_len, len, NULL, NULL));
--- a/libpurple/protocols/zephyr/ZNewLocU.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZLocateUser function.
- * Created by: Robert French
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZLocateUser(char *user, int *nlocs, Z_AuthProc auth)
- ZAsyncLocateData_t zald;
- (void) ZFlushLocations(); /* ZFlushLocations never fails (the library
- is allowed to know this). */
- if ((retval = ZRequestLocations(user, &zald, UNACKED, auth)) != ZERR_NONE)
- retval = Z_WaitForNotice (¬ice, ZCompareALDPred, &zald, SRV_TIMEOUT);
- if (retval == ZERR_NONOTICE)
- if (retval != ZERR_NONE)
- if ((retval = ZParseLocations(¬ice, &zald, nlocs, NULL)) != ZERR_NONE) {
--- a/libpurple/protocols/zephyr/ZOpenPort.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZOpenPort function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZOpenPort(unsigned short *port)
- GSocketAddress *bindin = NULL;
- __Zephyr_socket = g_socket_new(G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM,
- G_SOCKET_PROTOCOL_DEFAULT, &error);
- if (__Zephyr_socket == NULL) {
- purple_debug_error("zephyr", "Failed to open socket: %s",
- bindin = g_inet_socket_address_new_from_string("0.0.0.0", port ? *port : 0);
- if (!g_socket_bind(__Zephyr_socket, bindin, FALSE, &error)) {
- gint err = ZERR_INTERNAL;
- if (error->code == G_IO_ERROR_ADDRESS_IN_USE && port && *port) {
- purple_debug_error("zephyr", "Failed to bind socket to port %d: %s",
- port ? *port : 0, error->message);
- g_object_unref(bindin);
- g_clear_object(&__Zephyr_socket);
- g_object_unref(bindin);
- bindin = g_socket_get_local_address(__Zephyr_socket, &error);
- purple_debug_error("zephyr", "Failed to get bound socket port: %s",
- g_clear_object(&__Zephyr_socket);
- g_inet_socket_address_get_port(G_INET_SOCKET_ADDRESS(bindin));
- g_object_unref(bindin);
--- a/libpurple/protocols/zephyr/ZParseNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZParseNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-/* Assume that strlen is efficient on this machine... */
-#define next_field(ptr) ptr += strlen (ptr) + 1
-#if defined (__GNUC__) && defined (__vax__)
-static __inline__ char * Istrend (char *str) {
- * This should be faster on VAX models outside the 2 series. Don't
- * use it if you are using MicroVAX 2 servers. If you are using a
- * VS2 server, use something like
- * #define next_field(ptr) while(*ptr++)
- * instead of this code.
- * This requires use of GCC to get the optimized code, but
- * everybody uses GCC, don't they? :-)
- register char *str2 asm ("r1");
- /* Assumes that no field is longer than 64K.... */
- asm ("locc $0,$65535,(%1)" : "=r" (str2) : "r" (str) : "r0");
-#define next_field(ptr) ptr = Istrend (ptr) + 1
- * The compiler doesn't optimize this macro as well as it does the
-#define next_fieldXXX(ptr) do{register unsigned c1,c2;c1= *ptr; \
- while((ptr++,c2= *ptr,c1)&&(ptr++,c1= *ptr,c2));}while(0)
-static char *next_field_1 (s) char *s; {
- * Calling overhead is still present, but this routine is faster
- * than strlen, and doesn't bother with some of the other math
- * that we'd just have to undo later anyways.
- register unsigned c1 = *s, c2;
- s++; c2 = *s; if (c1 == 0) break;
- s++; c1 = *s; if (c2 == 0) break;
- s++; c2 = *s; if (c1 == 0) break;
- s++; c1 = *s; if (c2 == 0) break;
-#define next_field(ptr) ptr=next_field_1(ptr)
-ZParseNotice(char *buffer, int len, ZNotice_t *notice)
- /* Note: This definition of BAD eliminates lint and compiler
- * complains about the "while (0)", but require that the macro not
- * be used as the "then" part of an "if" statement that also has
-#define BAD_PACKET {lineno=__LINE__;goto badpkt;}
- /* This one gets lint/compiler complaints. */
-/*#define BAD do{lineno=__LINE__;goto badpkt;}while(0)*/
-#define BAD_PACKET goto badpkt
- (void) memset((char *)notice, 0, sizeof(ZNotice_t));
- notice->z_packet = buffer;
- notice->z_version = ptr;
- if (strncmp(ptr, ZVERSIONHDR, sizeof(ZVERSIONHDR) - 1))
- ptr += sizeof(ZVERSIONHDR) - 1;
- purple_debug_error("zephyr", "ZParseNotice: null version string");
- if (maj != ZVERSIONMAJOR)
- if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
- numfields -= 2; /* numfields, version, and checksum */
- GInetAddress *inet_addr = NULL;
- gchar *inet_addr_str = NULL;
- inet_addr = g_inet_address_new_from_bytes(
- (const guint8 *)¬ice->z_uid.zuid_addr,
- inet_addr_str = g_inet_address_to_string(inet_addr);
- purple_debug_error("zephyr", "ZParseNotice: bad packet from %s/%d (line %d)",
- inet_addr_str, notice->z_port, lineno);
- purple_debug_error("zephyr", "ZParseNotice: bad packet from %s/%d",
- inet_addr_str, notice->z_port);
- g_object_unref(inet_addr);
- if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid,
- sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
- notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_sec);
- notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_uid.tv.tv_usec);
- if (ZReadAscii16(ptr, end-ptr, ¬ice->z_port) == ZERR_BADFIELD)
- notice->z_port = g_htons(notice->z_port);
- if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
- notice->z_checked_auth = ZAUTH_UNSET;
- if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
- notice->z_authent_len = temp;
- notice->z_ascii_authent = ptr;
- notice->z_class_inst = ptr;
- notice->z_class_inst = "";
- notice->z_opcode = ptr;
- notice->z_sender = ptr;
- notice->z_recipient = ptr;
- notice->z_recipient = "";
- notice->z_default_format = ptr;
- notice->z_default_format = "";
- if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
- notice->z_checksum = temp;
- notice->z_multinotice = ptr;
- notice->z_multinotice = "";
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid,
- sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
- notice->z_time.tv_sec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_sec);
- notice->z_time.tv_usec = GUINT64_FROM_BE((guint64)notice->z_multiuid.tv.tv_usec);
- notice->z_multiuid = notice->z_uid;
- for (i=0;i<Z_MAXOTHERFIELDS && numfields;i++,numfields--) {
- notice->z_other_fields[i] = ptr;
- notice->z_num_other_fields = i;
- for (i=0;i<numfields;i++)
- notice->z_message = (void *)ptr;
- notice->z_message_len = len-(ptr-buffer);
--- a/libpurple/protocols/zephyr/ZPeekNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for ZPeekNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZPeekNotice(ZNotice_t *notice, GSocketAddress **from)
- if ((retval = ZPeekPacket(&buffer, &len, from)) != ZERR_NONE)
- return (ZParseNotice(buffer, len, notice));
--- a/libpurple/protocols/zephyr/ZPeekPkt.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for ZPeekPacket function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZPeekPacket(char **buffer, int *ret_len, GSocketAddress **from)
- if ((retval = Z_WaitForComplete()) != ZERR_NONE)
- nextq =Z_GetFirstComplete();
- *ret_len = nextq->packet_len;
- if (!(*buffer = (char *) malloc((unsigned) *ret_len)))
- (void) memcpy(*buffer, nextq->packet, *ret_len);
- *from = g_object_ref(nextq->from);
--- a/libpurple/protocols/zephyr/ZPending.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZPending function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- if (ZGetSocket() == NULL) {
- if ((retval = Z_ReadEnqueue()) != ZERR_NONE) {
--- a/libpurple/protocols/zephyr/ZReadAscii.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZReadAscii function.
- * Created by: Robert French
- * Copyright (c) 1987, 1990 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?(int)temp:((temp-='A'-'9'-1),(temp<16)?(int)temp:-1))
-ZReadAscii(char *ptr, int len, unsigned char *field, int num)
- register unsigned int temp;
- if (ptr[0] == '0' && ptr[1] == 'x') {
- c1 = Z_cnvt_xtoi(ptr[0]);
- c2 = Z_cnvt_xtoi(ptr[1]);
- hexbyte = (c1 << 4) | c2;
- return *ptr ? ZERR_BADFIELD : ZERR_NONE;
-ZReadAscii32(char *ptr, int len, unsigned long *value_ptr)
- unsigned long value = 0;
- retval = ZReadAscii(ptr, len, buf, 4);
- if (retval != ZERR_NONE)
- value |= (unsigned long)buf[0] << 24;
-ZReadAscii16(char *ptr, int len, unsigned short *value_ptr)
- retval = ZReadAscii(ptr, len, buf, 2);
- if (retval != ZERR_NONE)
- *value_ptr = (buf[0] << 8) | buf[1];
--- a/libpurple/protocols/zephyr/ZRecvNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for ZReceiveNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZReceiveNotice(ZNotice_t *notice, GSocketAddress **from)
- if ((retval = Z_WaitForComplete()) != ZERR_NONE)
- nextq = Z_GetFirstComplete();
- len = nextq->packet_len;
- if (!(buffer = (char *) malloc((unsigned) len)))
- *from = g_object_ref(nextq->from);
- (void) memcpy(buffer, nextq->packet, len);
- if ((retval = ZParseNotice(buffer, len, notice)) != ZERR_NONE)
- notice->z_checked_auth = auth;
--- a/libpurple/protocols/zephyr/ZRecvPkt.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for ZReceivePacket function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZReceivePacket(ZPacket_t buffer, int *ret_len, GSocketAddress **from)
- if ((retval = Z_WaitForComplete()) != ZERR_NONE)
- nextq = Z_GetFirstComplete();
- *ret_len = nextq->packet_len;
- if (*ret_len > Z_MAXPKTLEN)
- (void) memcpy(buffer, nextq->packet, *ret_len);
- *from = g_object_ref(nextq->from);
--- a/libpurple/protocols/zephyr/ZRetSubs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZRetrieveSubscriptions and
- * ZRetrieveDefaultSubscriptions functions.
- * Created by: Robert French
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-static Code_t Z_RetSubs(ZNotice_t *notice, int *nsubs, Z_AuthProc auth_routine);
-Code_t ZRetrieveSubscriptions(unsigned short port, int *nsubs)
- if (!port) /* use default port */
- retval = ZMakeAscii16(asciiport, sizeof(asciiport), g_ntohs(port));
- if (retval != ZERR_NONE)
- (void) memset((char *)¬ice, 0, sizeof(notice));
- notice.z_message = asciiport;
- notice.z_message_len = strlen(asciiport)+1;
- notice.z_opcode = CLIENT_GIMMESUBS;
- return(Z_RetSubs(¬ice, nsubs, ZAUTH));
-Z_RetSubs(register ZNotice_t *notice, int *nsubs, Z_AuthProc auth_routine)
- int retval,nrecv,gimmeack;
- retval = ZFlushSubscriptions();
- if (retval != ZERR_NONE && retval != ZERR_NOSUBSCRIPTIONS)
- if (ZGetSocket() == NULL) {
- retval = ZOpenPort(NULL);
- if (retval != ZERR_NONE) {
- notice->z_kind = ACKED;
- notice->z_port = __Zephyr_port;
- notice->z_class = ZEPHYR_CTL_CLASS;
- notice->z_class_inst = ZEPHYR_CTL_CLIENT;
- notice->z_recipient = "";
- notice->z_default_format = "";
- if ((retval = ZSendNotice(notice,auth_routine)) != ZERR_NONE)
- __subscriptions_list = (ZSubscription_t *) 0;
- while (!nrecv || !gimmeack) {
- retval = Z_WaitForNotice (&retnotice, ZCompareMultiUIDPred,
- ¬ice->z_multiuid, SRV_TIMEOUT);
- if (retval == ZERR_NONOTICE)
- else if (retval != ZERR_NONE)
- if (retnotice.z_kind == SERVNAK) {
- ZFreeNotice(&retnotice);
- /* non-matching protocol version numbers means the
- server is probably an older version--must punt */
- if (!purple_strequal(notice->z_version,retnotice.z_version)) {
- ZFreeNotice(&retnotice);
- if (retnotice.z_kind == SERVACK &&
- purple_strequal(retnotice.z_opcode,notice->z_opcode)) {
- ZFreeNotice(&retnotice);
- if (retnotice.z_kind != ACKED) {
- ZFreeNotice(&retnotice);
- return (ZERR_INTERNAL);
- end = retnotice.z_message+retnotice.z_message_len;
- __subscriptions_num = 0;
- for (ptr=retnotice.z_message;ptr<end;ptr++)
- __subscriptions_num = __subscriptions_num / 3;
- if (!__subscriptions_num) {
- ZFreeNotice(&retnotice);
- free(__subscriptions_list);
- __subscriptions_list = (ZSubscription_t *)
- malloc((unsigned)(__subscriptions_num*
- sizeof(ZSubscription_t)));
- if (!__subscriptions_list) {
- ZFreeNotice(&retnotice);
- for (ptr=retnotice.z_message,i = 0; i< __subscriptions_num; i++) {
- __subscriptions_list[i].zsub_class = (char *)
- if (!__subscriptions_list[i].zsub_class) {
- ZFreeNotice(&retnotice);
- g_strlcpy(__subscriptions_list[i].zsub_class,ptr,len);
- __subscriptions_list[i].zsub_classinst = (char *)
- if (!__subscriptions_list[i].zsub_classinst) {
- ZFreeNotice(&retnotice);
- g_strlcpy(__subscriptions_list[i].zsub_classinst,ptr,len);
- len = strlen(ptr2) + 1;
- __subscriptions_list[i].zsub_recipient = (char *)
- if (!__subscriptions_list[i].zsub_recipient) {
- ZFreeNotice(&retnotice);
- g_strlcpy(__subscriptions_list[i].zsub_recipient,ptr2,len);
- ZFreeNotice(&retnotice);
- __subscriptions_next = 0;
- *nsubs = __subscriptions_num;
--- a/libpurple/protocols/zephyr/ZSendList.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendList function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZSendList(ZNotice_t *notice, char *list[], int nitems, Z_AuthProc cert_routine)
- return(ZSrvSendList(notice, list, nitems, cert_routine, Z_XmitFragment));
-ZSrvSendList(ZNotice_t *notice, char *list[], int nitems,
- Z_AuthProc cert_routine, Code_t (*send_routine)())
- if ((retval = ZFormatNoticeList(notice, list, nitems, &buffer,
- &len, cert_routine)) != ZERR_NONE)
- if ((retval = ZParseNotice(buffer, len, &newnotice)) != ZERR_NONE)
- retval = Z_SendFragmentedNotice(&newnotice, len, cert_routine,
--- a/libpurple/protocols/zephyr/ZSendNot.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZSendNotice(ZNotice_t *notice, Z_AuthProc cert_routine)
- return(ZSrvSendNotice(notice, cert_routine, Z_XmitFragment));
-ZSrvSendNotice(ZNotice_t *notice, Z_AuthProc cert_routine,
- Code_t (*send_routine)())
- if ((retval = ZFormatNotice(notice, &buffer, &len,
- cert_routine)) != ZERR_NONE)
- if ((retval = ZParseNotice(buffer, len, &newnotice)) != ZERR_NONE)
- retval = Z_SendFragmentedNotice(&newnotice, len, cert_routine,
--- a/libpurple/protocols/zephyr/ZSendPkt.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendPacket function.
- * Created by: Robert French
- * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-static int wait_for_hmack(ZNotice_t *notice, void *uid);
-ZSendPacket(char *packet, int len, int waitforack)
- ZNotice_t notice, acknotice;
- if (packet == NULL || len < 0) {
- if (len > Z_MAXPKTLEN) {
- if (ZGetSocket() == NULL) {
- retval = ZOpenPort(NULL);
- if (retval != ZERR_NONE) {
- if (g_socket_send_to(ZGetSocket(), ZGetDestAddr(), packet, len, NULL,
- purple_debug_error("zephyr", "Failed to send packet of size %d: %s",
- if ((retval = ZParseNotice(packet, len, ¬ice)) != ZERR_NONE) {
- retval = Z_WaitForNotice(&acknotice, wait_for_hmack, ¬ice.z_uid,
- if (retval == ETIMEDOUT) {
- if (retval == ZERR_NONE) {
- ZFreeNotice(&acknotice);
-static int wait_for_hmack(ZNotice_t *notice, void *uid)
- return (notice->z_kind == HMACK && ZCompareUID(¬ice->z_uid, (ZUnique_Id_t *)uid));
--- a/libpurple/protocols/zephyr/ZSetDest.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSetDestAddr function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZSetDestAddr(GSocketAddress *addr)
- g_set_object(&__HM_addr, addr);
--- a/libpurple/protocols/zephyr/ZSubs.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSubscribeTo, ZUnsubscribeTo, and
- * ZCancelSubscriptions functions.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-static Code_t Z_Subscriptions(register ZSubscription_t *sublist, int nitems,
- unsigned int port, char *opcode, int authit);
-static Code_t subscr_sendoff(ZNotice_t *notice, char **lyst, int num,
-ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port)
- return (Z_Subscriptions(sublist, nitems, port, CLIENT_SUBSCRIBE, 1));
-ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems,
- return (Z_Subscriptions(sublist, nitems, port, CLIENT_SUBSCRIBE_NODEFS,
-ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port)
- return (Z_Subscriptions(sublist, nitems, port, CLIENT_UNSUBSCRIBE, 1));
-ZCancelSubscriptions(unsigned int port)
- return (Z_Subscriptions((ZSubscription_t *)0, 0, port,
- * This routine must do its own fragmentation. Subscriptions must
- * not be broken across packet boundaries, or else the server will
-Z_Subscriptions(register ZSubscription_t *sublist, int nitems,
- unsigned int port, char *opcode, int authit)
- char header[Z_MAXHEADERLEN];
- int size_avail = Z_MAXPKTLEN-Z_FRAGFUDGE; /* space avail for data,
- int size, start, numok;
- /* nitems = 0 means cancel all subscriptions; still need to allocate a */
- /* array for one item so we can cancel, however. */
- list = (char **)malloc((unsigned)((nitems==0)?1:nitems)*3*sizeof(char *));
- (void) memset((char *)¬ice, 0, sizeof(notice));
- notice.z_class = ZEPHYR_CTL_CLASS;
- notice.z_class_inst = ZEPHYR_CTL_CLIENT;
- notice.z_opcode = opcode;
- notice.z_recipient = "";
- notice.z_default_format = "";
- notice.z_message_len = 0;
- /* format the header to figure out how long it is */
- retval = Z_FormatHeader(¬ice, header, sizeof(header), &hdrlen, ZAUTH);
- if (retval != ZERR_NONE && !authit)
- retval = Z_FormatHeader(¬ice, header, sizeof(header),
- if (retval != ZERR_NONE) {
- /* compute amount of room left */
- /* assemble subs into an array of pointers */
- for (i=0;i<nitems;i++) {
- list[i*3] = sublist[i].zsub_class;
- list[i*3+1] = sublist[i].zsub_classinst;
- recip = sublist[i].zsub_recipient;
- if (recip && *recip == '*')
- if (!recip || (*recip != 0 && *recip != '@'))
- /* there aren't really any, but we need to xmit anyway */
- retval = subscr_sendoff(¬ice, list, 0, authit);
- if ((j = strlen(list[i*3])
- + strlen(list[i*3+2]) + 3) <= size) {
- /* it will fit in this packet */
- if (!numok) { /* a single subscription won't
- retval = subscr_sendoff(¬ice, &list[start*3], numok, authit);
- retval = subscr_sendoff(¬ice, &list[start*3], numok, authit);
-subscr_sendoff(ZNotice_t *notice, char **lyst, int num, int authit)
- register Code_t retval;
- retval = ZSendList(notice, lyst, num*3, ZAUTH);
- if (retval != ZERR_NONE && !authit)
- retval = ZSendList(notice, lyst, num*3, ZNOAUTH);
- if (retval != ZERR_NONE)
- retval = ZIfNotice(&retnotice, NULL, ZCompareUIDPred,
- (char *)¬ice->z_uid);
- if (retval != ZERR_NONE) {
- if (retnotice.z_kind == SERVNAK) {
- ZFreeNotice(&retnotice);
- if (retnotice.z_kind != SERVACK) {
- ZFreeNotice(&retnotice);
- return (ZERR_INTERNAL);
- ZFreeNotice(&retnotice);
--- a/libpurple/protocols/zephyr/ZVariables.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZGetVariable, ZSetVariable, and ZUnsetVariable
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#include <glib/gstdio.h>
-static char *get_localvarfile(void);
-static const gchar *get_varval(const gchar *fn, const gchar *val);
-static int varline(const gchar *bfr, const gchar *var);
-ZGetVariable(const gchar *var)
- if ((varfile = get_localvarfile()) == NULL)
- ret = get_varval(varfile, var);
- varfile = g_strdup("C:\\zephyr\\zephyr.var");
- varfile = g_build_filename(PURPLE_SYSCONFDIR, "zephyr.vars", NULL);
- ret = get_varval(varfile, var);
-ZSetVariable(char *var, char *value)
- char *varfile, *varfilebackup, varbfr[512];
- if ((varfile = get_localvarfile()) == NULL)
- return (ZERR_INTERNAL);
- varfilebackup = g_strconcat(varfile, ".backup", NULL);
- if (!(fpout = fopen(varfilebackup, "w"))) {
- if ((fpin = fopen(varfile, "r")) != NULL) {
- while (fgets(varbfr, sizeof varbfr, fpin) != (char *) 0) {
- if (varbfr[strlen(varbfr)-1] < ' ')
- varbfr[strlen(varbfr)-1] = '\0';
- if (varline(varbfr, var)) {
- fprintf(fpout, "%s = %s\n", var, value);
- fprintf(fpout, "%s\n", varbfr);
- (void) fclose(fpin); /* don't care about errs on input */
- fprintf(fpout, "%s = %s\n", var, value);
- if (fclose(fpout) == EOF) {
- return(EIO); /* can't rely on errno */
- if (g_rename(varfilebackup, varfile)) {
-ZUnsetVariable(char *var)
- char *varfile, *varfilebackup, varbfr[512];
- if ((varfile = get_localvarfile()) == NULL)
- return (ZERR_INTERNAL);
- varfilebackup = g_strconcat(varfile, ".backup", NULL);
- if (!(fpout = fopen(varfilebackup, "w"))) {
- if ((fpin = fopen(varfile, "r")) != NULL) {
- while (fgets(varbfr, sizeof varbfr, fpin) != (char *) 0) {
- if (varbfr[strlen(varbfr)-1] < ' ')
- varbfr[strlen(varbfr)-1] = '\0';
- if (!varline(varbfr, var))
- fprintf(fpout, "%s\n", varbfr);
- (void) fclose(fpin); /* don't care about read close errs */
- if (fclose(fpout) == EOF) {
- return(EIO); /* errno isn't reliable */
- if (g_rename(varfilebackup, varfile)) {
-static char *get_localvarfile(void)
- base = purple_home_dir();
- base = getenv("HOMEPATH");
- if (!(pwd = getpwuid((int) getuid()))) {
- fprintf(stderr, "Zephyr internal failure: Can't find your entry in /etc/passwd\n");
- return g_strconcat(base, "/.zephyr.vars", NULL);
-get_varval(const gchar *fn, const gchar *var)
- static gchar varbfr[512];
- while (fgets(varbfr, sizeof varbfr, fp) != (char *) 0) {
- if (varbfr[strlen(varbfr)-1] < ' ')
- varbfr[strlen(varbfr)-1] = '\0';
- if (!(i = varline(varbfr, var)))
- (void) fclose(fp); /* open read-only, don't care */
- (void) fclose(fp); /* open read-only, don't care */
-/* If the variable in the line bfr[] is the same as var, return index to
- the variable value, else return 0. */
-varline(const gchar *bfr, const gchar *var)
- register const gchar *cp;
- if (!bfr[0] || bfr[0] == '#') {
- /* comment or null line */
- while (*cp && !isspace(*cp) && (*cp != '=')) {
- if (g_ascii_strncasecmp(bfr, var, MAX(strlen(var), (gsize)(cp - bfr)))) {
- /* var is not the var in bfr ==> no match */
- while (*cp && isspace(*cp)) {
- /* space up to variable value */
- return (cp - bfr); /* return index */
--- a/libpurple/protocols/zephyr/ZWait4Not.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains the ZCheckIfNotice/select loop used for waiting for
- * a notice, with a timeout.
- * Copyright (c) 1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Z_WaitForNotice(ZNotice_t *notice, int (*pred)(ZNotice_t *, void *), void *arg,
- gint64 t0, tdiff, timeout_us;
- retval = ZCheckIfNotice(notice, NULL, pred, (char *)arg);
- if (retval == ZERR_NONE) {
- if (retval != ZERR_NONOTICE) {
- timeout_us = timeout * G_USEC_PER_SEC;
- t0 = g_get_monotonic_time() + timeout_us;
- if (!g_socket_condition_timed_wait(ZGetSocket(), G_IO_IN, timeout_us,
- gint ret = ZERR_INTERNAL;
- if (error->code == G_IO_ERROR_TIMED_OUT) {
- retval = ZCheckIfNotice(notice, NULL, pred, (char *)arg);
- if (retval != ZERR_NONOTICE) {
- /* includes ZERR_NONE */
- tdiff = t0 - g_get_monotonic_time();
- /* g_socket_condition_timed_wait requires timeout to be an integral
- * number of milliseconds. */
- timeout_us = (tdiff / 1000 + 1) * 1000;
--- a/libpurple/protocols/zephyr/ZhmStat.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains the ZhmStat() function.
- * Created by: Marc Horowitz
- * Copyright (c) 1996 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-ZhmStat(ZNotice_t *notice)
- GInetAddress *inet_addr = NULL;
- GSocketAddress *addr = NULL;
- sp = getservbyname(HM_SVCNAME, "udp");
- memset(&req, 0, sizeof(req));
- req.z_class = HM_STAT_CLASS;
- req.z_class_inst = HM_STAT_CLIENT;
- req.z_opcode = HM_GIMMESTATS;
- req.z_default_format = "";
- inet_addr = g_inet_address_new_loopback(G_SOCKET_FAMILY_IPV4);
- addr = g_inet_socket_address_new(inet_addr,
- sp ? sp->s_port : HM_SVC_FALLBACK);
- code = ZSetDestAddr(addr);
- g_object_unref(inet_addr);
- if (code != ZERR_NONE) {
- if ((code = ZSendNotice(&req, ZNOAUTH)) != ZERR_NONE) {
- /* Wait up to ten seconds for a response. */
- if (!g_socket_condition_timed_wait(ZGetSocket(), G_IO_IN,
- 10 * G_USEC_PER_SEC, NULL, &error)) {
- gint ret = ZERR_INTERNAL;
- if (error->code == G_IO_ERROR_TIMED_OUT) {
- return ZReceiveNotice(notice, NULL);
--- a/libpurple/protocols/zephyr/Zinternal.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,810 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the internal Zephyr routines.
- * Created by: Robert French
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of
- * For copying and distribution information, see the file
-#include "libpurple/glibcompat.h"
-GSocket *__Zephyr_socket = NULL;
-gint __Zephyr_port = -1;
-GQueue Z_input_queue = G_QUEUE_INIT;
-GSocketAddress *__HM_addr;
-ZLocations_t *__locate_list;
-ZSubscription_t *__subscriptions_list;
-int __subscriptions_num;
-int __subscriptions_next;
-int Z_discarded_packets = 0;
-#ifdef ZEPHYR_USES_KERBEROS
-C_Block __Zephyr_session;
-char __Zephyr_realm[REALM_SZ];
-static int Z_AddField(char **ptr, const char *field, char *end);
-static int find_or_insert_uid(ZUnique_Id_t *uid, ZNotice_Kind_t kind);
-/* Find or insert uid in the old uids buffer. The buffer is a sorted
- * circular queue. We make the assumption that most packets arrive in
- * order, so we can usually search for a uid or insert it into the buffer
- * by looking back just a few entries from the end. Since this code is
- * only executed by the client, the implementation isn't microoptimized. */
-find_or_insert_uid(ZUnique_Id_t *uid, ZNotice_Kind_t kind)
- static struct _filter {
- /* Initialize the uid buffer if it hasn't been done already. */
- size = Z_INITFILTERSIZE;
- buffer = (struct _filter *) malloc(size * sizeof(*buffer));
- /* Age the uid buffer, discarding any uids older than the clock skew. */
- while (num && (now - buffer[start % size].t) > CLOCK_SKEW)
- /* Make room for a new uid, since we'll probably have to insert one. */
- new_size = size * 2 + 2;
- new = (struct _filter *) malloc(new_size * sizeof(*new));
- for (i = 0; i < num; i++)
- new[i] = buffer[(start + i) % size];
- /* Search for this uid in the buffer, starting from the end. */
- for (i = start + num - 1; i >= start; i--) {
- result = memcmp(uid, &buffer[i % size].uid, sizeof(*uid));
- if (result == 0 && buffer[i % size].kind == kind)
- /* We didn't find it; insert the uid into the buffer after i. */
- for (j = start + num; j > i; j--)
- buffer[j % size] = buffer[(j - 1) % size];
- buffer[i % size].uid = *uid;
- buffer[i % size].kind = kind;
- buffer[i % size].t = now;
-/* Wait for a complete notice to become available */
-Code_t Z_WaitForComplete(void)
- if (__Q_CompleteLength)
- return (Z_ReadEnqueue());
- while (!__Q_CompleteLength)
- if ((retval = Z_ReadWait()) != ZERR_NONE)
-/* Read any available packets and enqueue them */
- if (ZGetSocket() == NULL) {
- while (g_socket_condition_check(ZGetSocket(), G_IO_IN)) {
- Code_t retval = Z_ReadWait();
- if (retval != ZERR_NONE) {
- * Search the queue for a notice with the proper multiuid - remove any
- * notices that haven't been touched in a while
-Z_SearchQueue(ZUnique_Id_t *uid, ZNotice_Kind_t kind)
- now = g_get_monotonic_time();
- list = Z_input_queue.head;
- Z_InputQ *qptr = (Z_InputQ *)list->data;
- if (ZCompareUID(uid, &qptr->uid) && qptr->kind == kind) {
- if (qptr->time && qptr->time + Z_NOTICETIMELIMIT < now) {
- * Now we delve into really convoluted queue handling and
- * fragmentation reassembly algorithms and other stuff you probably
- * don't want to look at...
- * This routine does NOT guarantee a complete packet will be ready when it
- register Z_InputQ *qptr;
- GSocketAddress *from = NULL;
- int packet_len, zvlen, part, partof;
- if (ZGetSocket() == NULL) {
- if (!g_socket_condition_timed_wait(ZGetSocket(), G_IO_IN,
- 60 * G_USEC_PER_SEC, NULL, &error)) {
- gint ret = ZERR_INTERNAL;
- if (error->code == G_IO_ERROR_TIMED_OUT) {
- packet_len = g_socket_receive_from(ZGetSocket(), &from, packet,
- sizeof(packet) - 1, NULL, &error);
- purple_debug_error("zephyr", "Unable to receive from socket: %s",
- packet[packet_len] = '\0';
- /* Ignore obviously non-Zephyr packets. */
- zvlen = sizeof(ZVERSIONHDR) - 1;
- if (packet_len < zvlen || memcmp(packet, ZVERSIONHDR, zvlen) != 0) {
- if ((retval = ZParseNotice(packet, packet_len, ¬ice)) != ZERR_NONE) {
- /* If the notice is of an appropriate kind, send back a CLIENTACK to
- * whoever sent it to say we got it. */
- if (notice.z_kind != HMACK && notice.z_kind != SERVACK &&
- notice.z_kind != SERVNAK && notice.z_kind != CLIENTACK) {
- GSocketAddress *olddest = NULL;
- tmpnotice.z_kind = CLIENTACK;
- tmpnotice.z_message_len = 0;
- if ((retval = ZFormatSmallRawNotice(&tmpnotice, pkt, &len)) != ZERR_NONE) {
- if ((retval = ZSendPacket(pkt, len, 0)) != ZERR_NONE) {
- if (find_or_insert_uid(¬ice.z_uid, notice.z_kind)) {
- /* Check authentication on the notice. */
- notice.z_checked_auth = ZCheckAuthentication(¬ice);
- * Parse apart the z_multinotice field - if the field is blank for
- * some reason, assume this packet stands by itself.
- slash = strchr(notice.z_multinotice, '/');
- part = atoi(notice.z_multinotice);
- partof = atoi(slash+1);
- if (part > partof || partof == 0) {
- partof = notice.z_message_len;
- partof = notice.z_message_len;
- /* Too big a packet...just ignore it! */
- if (partof > Z_MAXNOTICESIZE) {
- /* If we can find a notice in the queue with the same multiuid field,
- * insert the current fragment as appropriate. */
- switch (notice.z_kind) {
- /* The SERVACK and SERVNAK replies shouldn't be reassembled
- (they have no parts). Instead, we should hold on to the reply
- ONLY if it's the first part of a fragmented message, i.e.
- multi_uid == uid. This allows programs to wait for the uid
- of the first packet, and get a response when that notice
- arrives. Acknowledgements of the other fragments are discarded
- (XXX we assume here that they all carry the same information
- regarding failure/success)
- if (!ZCompareUID(¬ice.z_multiuid, ¬ice.z_uid)) {
- /* they're not the same... throw away this packet. */
- /* fall thru & process it */
- /* for HMACK types, we assume no packet loss (local loopback
- connections). The other types can be fragmented and MUST
- run through this code. */
- if ((qptr = Z_SearchQueue(¬ice.z_multiuid, notice.z_kind)) != NULL) {
- /* If this is the first fragment, and we haven't already gotten
- * a first fragment, grab the header from it. */
- if (part == 0 && qptr->header == NULL) {
- qptr->header_len = packet_len - notice.z_message_len;
- qptr->header = g_memdup2(packet, qptr->header_len);
- return Z_AddNoticeToEntry(qptr, ¬ice, part);
- /* We'll have to create a new entry...make sure the queue isn't going
- if (__Q_Size + partof > Z_MAXQUEUESIZE) {
- /* This is a notice we haven't heard of, so create a new queue entry
- * for it and zero it out. */
- qptr = g_new0(Z_InputQ, 1);
- /* Insert the entry at the end of the queue */
- g_queue_push_tail(&Z_input_queue, qptr);
- /* Copy the from field, multiuid, kind, and checked authentication. */
- qptr->uid = notice.z_multiuid;
- qptr->kind = notice.z_kind;
- qptr->auth = notice.z_checked_auth;
- /* If this is the first part of the notice, we take the header from it.
- * We only take it if this is the first fragment so that the Unique
- * ID's will be predictable. */
- qptr->header_len = packet_len - notice.z_message_len;
- qptr->header = g_memdup2(packet, qptr->header_len);
- /* If this is not a fragmented notice, then don't bother with a hole
- if (part == 0 && notice.z_message_len == partof) {
- /* allocate a msg buf for this piece */
- if (notice.z_message_len == 0) {
- qptr->msg = g_memdup2(notice.z_message, notice.z_message_len);
- qptr->msg_len = notice.z_message_len;
- __Q_Size += notice.z_message_len;
- qptr->packet_len = qptr->header_len + qptr->msg_len;
- qptr->packet = g_new(gchar, qptr->packet_len);
- memcpy(qptr->packet, qptr->header, qptr->header_len);
- memcpy(qptr->packet + qptr->header_len, qptr->msg, qptr->msg_len);
- /* We know how long the message is going to be (this is better than IP
- * fragmentation...), so go ahead and allocate it all. */
- qptr->msg = g_new0(gchar, partof);
- qptr->msg_len = partof;
- * Well, it's a fragmented notice...allocate a hole list and
- * initialize it to the full packet size. Then insert the
- hole = g_new0(Z_Hole, 1);
- hole->last = partof - 1;
- qptr->holelist = g_slist_prepend(qptr->holelist, hole);
- return Z_AddNoticeToEntry(qptr, ¬ice, part);
-/* Fragment management routines - compliments, more or less, of RFC815 */
-find_hole(gconstpointer element, gconstpointer data)
- Z_Hole *thishole = (Z_Hole *)element;
- Z_Hole *tofind = (Z_Hole *)data;
- if (tofind->first <= thishole->last && tofind->last >= thishole->first) {
-Z_AddNoticeToEntry(Z_InputQ *qptr, ZNotice_t *notice, int part)
- /* Incorporate this notice's checked authentication. */
- if (notice->z_checked_auth == ZAUTH_FAILED) {
- qptr->auth = ZAUTH_FAILED;
- } else if (notice->z_checked_auth == ZAUTH_NO && qptr->auth != ZAUTH_FAILED) {
- qptr->time = g_get_monotonic_time();
- last = part + notice->z_message_len - 1;
- /* copy in the message body */
- memcpy(qptr->msg + part, notice->z_message, notice->z_message_len);
- /* Search for a hole that overlaps with the current fragment */
- hole = g_new(Z_Hole, 1);
- thishole = g_slist_find_custom(qptr->holelist, hole, find_hole);
- /* If we found one, delete it and reconstruct a new hole */
- gint oldfirst, oldlast;
- hole = (Z_Hole *)thishole->data;
- oldfirst = hole->first;
- qptr->holelist = g_slist_delete_link(qptr->holelist, thishole);
- * Now create a new hole that is the original hole without the
- hole = g_new0(Z_Hole, 1);
- qptr->holelist = g_slist_prepend(qptr->holelist, hole);
- hole->first = oldfirst;
- hole = g_new0(Z_Hole, 1);
- qptr->holelist = g_slist_prepend(qptr->holelist, hole);
- hole->first = last + 1;
- /* If there are no more holes, the packet is complete. */
- if (qptr->holelist == NULL) {
- qptr->time = 0; /* don't time out anymore */
- qptr->packet_len = qptr->header_len + qptr->msg_len;
- qptr->packet = g_new(gchar, qptr->packet_len);
- memcpy(qptr->packet, qptr->header, qptr->header_len);
- memcpy(qptr->packet + qptr->header_len, qptr->msg, qptr->msg_len);
-Z_FormatHeader(ZNotice_t *notice, char *buffer, int buffer_len, int *len,
- Z_AuthProc cert_routine)
- static char version[BUFSIZ]; /* default init should be all \0 */
- if (!notice->z_sender) {
- notice->z_sender = ZGetSender();
- if (notice->z_port == 0) {
- GSocketAddress *addr = NULL;
- if (ZGetSocket() == NULL) {
- Code_t retval = ZOpenPort(NULL);
- if (retval != ZERR_NONE) {
- addr = g_socket_get_local_address(ZGetSocket(), &error);
- purple_debug_error("zephyr",
- "Unable to determine socket local address: %s",
- g_inet_socket_address_get_port(G_INET_SOCKET_ADDRESS(addr));
- notice->z_multinotice = "";
- realtime = g_get_real_time();
- notice->z_uid.tv.tv_sec = realtime / G_USEC_PER_SEC;
- notice->z_uid.tv.tv_usec =
- realtime - notice->z_uid.tv.tv_sec * G_USEC_PER_SEC;
- notice->z_uid.tv.tv_sec = GUINT64_TO_BE((guint64)notice->z_uid.tv.tv_sec);
- notice->z_uid.tv.tv_usec = GUINT64_TO_BE((guint64)notice->z_uid.tv.tv_usec);
- memcpy(¬ice->z_uid.zuid_addr, &__My_addr, sizeof(__My_addr));
- notice->z_multiuid = notice->z_uid;
- sprintf(version, "%s%d.%d", ZVERSIONHDR, ZVERSIONMAJOR, ZVERSIONMINOR);
- notice->z_version = version;
- return Z_FormatAuthHeader(notice, buffer, buffer_len, len, cert_routine);
-Z_FormatAuthHeader(ZNotice_t *notice, char *buffer, int buffer_len, int *len,
- Z_AuthProc cert_routine)
- notice->z_authent_len = 0;
- notice->z_ascii_authent = "";
- notice->z_checksum = 0;
- return (Z_FormatRawHeader(notice, buffer, buffer_len,
- return ((*cert_routine)(notice, buffer, buffer_len, len));
-Z_FormatRawHeader(ZNotice_t *notice, char *buffer, gsize buffer_len, int *len,
- char **cstart, char **cend)
- if (!notice->z_class_inst)
- notice->z_class_inst = "";
- if (!notice->z_recipient)
- notice->z_recipient = "";
- if (!notice->z_default_format)
- notice->z_default_format = "";
- end = buffer+buffer_len;
- if (buffer_len < strlen(notice->z_version)+1)
- return (ZERR_HEADERLEN);
- g_strlcpy(ptr, notice->z_version, buffer_len);
- if (ZMakeAscii32(ptr, end-ptr, Z_NUMFIELDS + notice->z_num_other_fields)
- return (ZERR_HEADERLEN);
- if (ZMakeAscii32(ptr, end-ptr, notice->z_kind) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid,
- sizeof(ZUnique_Id_t)) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (ZMakeAscii16(ptr, end-ptr, g_ntohs(notice->z_port)) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (ZMakeAscii32(ptr, end-ptr, notice->z_auth) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (ZMakeAscii32(ptr, end-ptr, notice->z_authent_len) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_ascii_authent, end))
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_class, end))
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_class_inst, end))
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_opcode, end))
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_sender, end))
- return (ZERR_HEADERLEN);
- if (strchr(notice->z_recipient, '@') || !*notice->z_recipient) {
- if (Z_AddField(&ptr, notice->z_recipient, end))
- return (ZERR_HEADERLEN);
- if (strlen(notice->z_recipient) + strlen(__Zephyr_realm) + 2 >
- return (ZERR_HEADERLEN);
- (void) sprintf(newrecip, "%s@%s", notice->z_recipient, __Zephyr_realm);
- if (Z_AddField(&ptr, newrecip, end))
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_default_format, end))
- return (ZERR_HEADERLEN);
- /* copy back the end pointer location for crypto checksum */
- if (ZMakeAscii32(ptr, end-ptr, notice->z_checksum) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- if (Z_AddField(&ptr, notice->z_multinotice, end))
- return (ZERR_HEADERLEN);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid,
- sizeof(ZUnique_Id_t)) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- for (i=0;i<notice->z_num_other_fields;i++)
- if (Z_AddField(&ptr, notice->z_other_fields[i], end))
- return (ZERR_HEADERLEN);
-Z_AddField(char **ptr, const char *field, char *end)
- len = field ? strlen (field) + 1 : 1;
-find_complete_input(gconstpointer a, G_GNUC_UNUSED gconstpointer b)
- Z_InputQ *qptr = (Z_InputQ *)a;
- return qptr->complete ? 0 : 1;
-Z_GetFirstComplete(void)
- list = g_queue_find_custom(&Z_input_queue, NULL, find_complete_input);
- return list ? (Z_InputQ *)list->data : NULL;
-Z_GetNextComplete(Z_InputQ *qptr)
- GList *list = g_queue_find(&Z_input_queue, qptr);
- list = g_list_find_custom(list, NULL, find_complete_input);
- return list ? (Z_InputQ *)list->data : NULL;
-Z_RemQueue(Z_InputQ *qptr)
- __Q_Size -= qptr->msg_len;
- g_clear_object(&qptr->from);
- g_slist_free_full(qptr->holelist, g_free);
- g_queue_remove(&Z_input_queue, qptr);
-Z_SendFragmentedNotice(ZNotice_t *notice, int len, Z_AuthProc cert_func,
- int offset, hdrsize, fragsize, ret_len, message_len, waitforack;
- hdrsize = len-notice->z_message_len;
- fragsize = Z_MAXPKTLEN-hdrsize-Z_FRAGFUDGE;
- waitforack = (notice->z_kind == UNACKED || notice->z_kind == ACKED);
- while (offset < notice->z_message_len || !notice->z_message_len) {
- (void) sprintf(multi, "%d/%d", offset, notice->z_message_len);
- partnotice.z_multinotice = multi;
- gint64 realtime = g_get_real_time();
- partnotice.z_uid.tv.tv_sec = realtime / G_USEC_PER_SEC;
- partnotice.z_uid.tv.tv_usec =
- realtime - partnotice.z_uid.tv.tv_sec * G_USEC_PER_SEC;
- partnotice.z_uid.tv.tv_sec =
- GUINT64_TO_BE((guint64)partnotice.z_uid.tv.tv_sec);
- partnotice.z_uid.tv.tv_usec =
- GUINT64_TO_BE((guint64)partnotice.z_uid.tv.tv_usec);
- memcpy(&partnotice.z_uid.zuid_addr, &__My_addr, sizeof(__My_addr));
- message_len = MIN(notice->z_message_len - offset, fragsize);
- partnotice.z_message = (char*)notice->z_message+offset;
- partnotice.z_message_len = message_len;
- if ((retval = Z_FormatAuthHeader(&partnotice, buffer, Z_MAXHEADERLEN,
- &ret_len, cert_func)) != ZERR_NONE) {
- memcpy(buffer + ret_len, partnotice.z_message, message_len);
- if ((retval = (*send_func)(&partnotice, buffer, ret_len+message_len,
- waitforack)) != ZERR_NONE) {
- if (!notice->z_message_len)
-Z_XmitFragment(ZNotice_t *notice, char *buf, int len, int wait)
- return(ZSendPacket(buf, len, wait));
--- a/libpurple/protocols/zephyr/internal.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#ifndef PURPLE_ZEPHYR_INTERNAL_H
-#define PURPLE_ZEPHYR_INTERNAL_H
-#include <zephyr/zephyr.h>
-#include <zephyr_internal.h>
-#define MAXHOSTNAMELEN 512
-#define ETIMEDOUT WSAETIMEDOUT
-#define EADDRINUSE WSAEADDRINUSE
-#define MAXHOSTNAMELEN 4096
-#ifdef ZEPHYR_USES_HESIOD
-#ifndef ZEPHYR_USES_KERBEROS
-#define REALM_SZ MAXHOSTNAMELEN
-#define INST_SZ 0 /* no instances w/o Kerberos */
-#define ANAME_SZ 9 /* size of a username + null */
-#define CLOCK_SKEW 300 /* max time to cache packet ids */
-#endif /* PURPLE_ZEPHYR_INTERNAL_H */
--- a/libpurple/protocols/zephyr/meson.build Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-ZEPHYR_INTERNAL_SOURCES = [
- 'mit-sipb-copyright.h',
- ZEPHYR_SOURCES += ZEPHYR_INTERNAL_SOURCES
- zephyr_resources = gnome.compile_resources('zephyrresource',
- 'resources/zephyr.gresource.xml',
- source_dir : 'resources',
- ZEPHYR_SOURCES += zephyr_resources
- zephyr_prpl = shared_library('zephyr', ZEPHYR_SOURCES,
- c_args : ['-Dlint', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Zephyr"'],
- dependencies : [extdep, libpurple_dep, glib],
- install : true, install_dir : PURPLE_PLUGINDIR)
- devenv.append('PURPLE_PLUGIN_PATH', meson.current_build_dir())
--- a/libpurple/protocols/zephyr/mit-copyright.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-Copyright 1987,1988 by the Massachusetts Institute of Technology
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the Massachusetts
-Institute of Technology (M.I.T.) not be used in advertising or publicity
-pertaining to distribution of the software without specific, written
-M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
--- a/libpurple/protocols/zephyr/mit-sipb-copyright.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-Copyright 1987, 1989 by the Student Information Processing Board
- of the Massachusetts Institute of Technology
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is
-hereby granted, provided that the above copyright notice
-appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation,
-and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution
-of the software without specific, written prior permission.
-M.I.T. and the M.I.T. S.I.P.B. make no representations about
-the suitability of this software for any purpose. It is
-provided "as is" without express or implied warranty.
Binary file libpurple/protocols/zephyr/resources/icons/16x16/apps/im-zephyr.png has changed
--- a/libpurple/protocols/zephyr/resources/icons/16x16/apps/scalable/im-zephyr.svg Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- sodipodi:docbase="/home/hbons/GUI/Tango/Gaim Refresh/protocols/16/scalable"
- sodipodi:docname="zephyr.svg"
- inkscape:export-filename="/home/hbons/Bureaublad/zephyr.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- inkscape:collect="always"
- id="linearGradient8662">
- style="stop-color:#729fcf;stop-opacity:1;"
- style="stop-color:#3465a4;stop-opacity:1"
- inkscape:collect="always"
- id="linearGradient8654">
- style="stop-color:#ffffff;stop-opacity:1;"
- style="stop-color:#ffffff;stop-opacity:0;"
- inkscape:collect="always"
- id="linearGradient8638">
- style="stop-color:#24579e;stop-opacity:1"
- style="stop-color:#1a3d70;stop-opacity:1"
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 8 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="16 : 8 : 1"
- inkscape:persp3d-origin="8 : 5.3333333 : 1"
- inkscape:collect="always"
- id="linearGradient5549">
- style="stop-color:#eeeeec;stop-opacity:1;"
- style="stop-color:#eeeeec;stop-opacity:0;"
- inkscape:collect="always"
- xlink:href="#linearGradient5549"
- id="linearGradient5555"
- gradientUnits="userSpaceOnUse" />
- inkscape:collect="always"
- xlink:href="#linearGradient8638"
- id="linearGradient8644"
- gradientUnits="userSpaceOnUse" />
- inkscape:collect="always"
- xlink:href="#linearGradient8638"
- id="linearGradient8648"
- gradientUnits="userSpaceOnUse"
- inkscape:collect="always"
- xlink:href="#linearGradient8654"
- id="linearGradient8660"
- gradientUnits="userSpaceOnUse" />
- inkscape:collect="always"
- xlink:href="#linearGradient8662"
- id="linearGradient8668"
- gradientUnits="userSpaceOnUse" />
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="10.355641"
- inkscape:cx="34.179106"
- inkscape:cy="17.513083"
- inkscape:current-layer="layer1"
- inkscape:grid-bbox="true"
- inkscape:document-units="px"
- inkscape:window-width="1440"
- inkscape:window-height="847"
- inkscape:snap-bbox="true"
- inkscape:snap-nodes="false"
- <dc:format>image/svg+xml</dc:format>
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- style="opacity:0;fill:none;fill-opacity:1;stroke:#a40000;stroke-width:1.13196862;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- transform="matrix(0.883816,0,0,0.883018,-2.999998,-1.426403)" />
- style="opacity:1;fill:url(#linearGradient8668);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient8644);stroke-width:0.99999994000000003;stroke-linecap:square;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="M 2.40625,0.50000003 C 1.9048,0.50000003 1.5,0.9048 1.5,1.40625 L 1.5,3.59375 C 1.5,4.0952 1.9048,4.5 2.40625,4.5 L 10.5,4.5 L 10.5,4.59375 C 10.5,5.09762 10.90238,5.5 11.40625,5.5 L 12.59375,5.5 C 13.09762,5.5 13.5,5.097621 13.5,4.59375 L 13.5,1.40625 C 13.5,1.280887 13.483182,1.170863 13.4375,1.0625 C 13.346137,0.845774 13.154226,0.65386303 12.9375,0.56250003 C 12.829137,0.51681806 12.719113,0.50000003 12.59375,0.50000003 L 11.40625,0.50000003 L 2.40625,0.50000003 z M 6.1875,6.5 C 5.8138457,6.5 5.5,6.8138458 5.5,7.1875 L 5.5,8.8125 C 5.5,9.1861543 5.8138458,9.4999998 6.1875,9.5 L 8.875,9.5 C 9.2486543,9.5 9.5625,9.1861539 9.5625,8.8125 L 9.5625,7.1875 C 9.5625,6.8138457 9.2486542,6.5 8.875,6.5 L 6.1875,6.5 z M 2.40625,10.5 C 1.9023796,10.5 1.5,10.902379 1.5,11.40625 L 1.5,14.59375 C 1.5,14.719113 1.5168185,14.829137 1.5625,14.9375 C 1.653863,15.154226 1.8457744,15.346137 2.0625,15.4375 C 2.1708628,15.483182 2.2808874,15.5 2.40625,15.5 L 3.59375,15.5 L 12.59375,15.5 C 13.0952,15.5 13.5,15.0952 13.5,14.59375 L 13.5,12.40625 C 13.5,11.9048 13.0952,11.5 12.59375,11.5 L 4.5,11.5 L 4.5,11.40625 C 4.5,10.90238 4.0976203,10.5 3.59375,10.5 L 2.40625,10.5 z"
- sodipodi:type="inkscape:offset"
- inkscape:radius="-1.0018694"
- inkscape:original="M 2.40625 0.5 C 1.9048 0.49999997 1.5 0.9048 1.5 1.40625 L 1.5 3.59375 C 1.5 4.0952 1.9048 4.5 2.40625 4.5 L 10.5 4.5 L 10.5 4.59375 C 10.5 5.09762 10.90238 5.5 11.40625 5.5 L 12.59375 5.5 C 13.09762 5.5 13.5 5.097621 13.5 4.59375 L 13.5 1.40625 C 13.5 1.280887 13.483182 1.170863 13.4375 1.0625 C 13.346137 0.845774 13.154226 0.653863 12.9375 0.5625 C 12.829137 0.516818 12.719113 0.5 12.59375 0.5 L 11.40625 0.5 L 2.40625 0.5 z M 6.1875 6.5 C 5.8138457 6.5 5.5 6.8138458 5.5 7.1875 L 5.5 8.8125 C 5.5 9.1861543 5.8138458 9.4999998 6.1875 9.5 L 8.875 9.5 C 9.2486543 9.5 9.5625 9.1861539 9.5625 8.8125 L 9.5625 7.1875 C 9.5625 6.8138457 9.2486542 6.5 8.875 6.5 L 6.1875 6.5 z M 2.40625 10.5 C 1.9023796 10.5 1.5 10.902379 1.5 11.40625 L 1.5 14.59375 C 1.5 14.719113 1.5168185 14.829137 1.5625 14.9375 C 1.653863 15.154226 1.8457744 15.346137 2.0625 15.4375 C 2.1708628 15.483182 2.2808874 15.5 2.40625 15.5 L 3.59375 15.5 L 12.59375 15.5 C 13.0952 15.5 13.5 15.0952 13.5 14.59375 L 13.5 12.40625 C 13.5 11.9048 13.0952 11.5 12.59375 11.5 L 4.5 11.5 L 4.5 11.40625 C 4.5 10.90238 4.0976203 10.5 3.59375 10.5 L 2.40625 10.5 z "
- style="opacity:0.62037037;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient8660);stroke-width:0.99999994000000003;stroke-linecap:square;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="M 2.5,1.5 L 2.5,3.5 L 10.5,3.5 C 11.051835,3.5010837 11.498916,3.9481648 11.5,4.5 L 12.5,4.5 L 12.5,1.5 L 11.40625,1.5 L 2.5,1.5 z M 6.5,7.5 L 6.5,8.5 L 8.5625,8.5 L 8.5625,7.5 L 6.5,7.5 z M 2.5,11.5 L 2.5,14.5 L 3.59375,14.5 L 12.5,14.5 L 12.5,12.5 L 4.5,12.5 C 3.9481648,12.498916 3.5010837,12.051835 3.5,11.5 L 2.5,11.5 z" />
Binary file libpurple/protocols/zephyr/resources/icons/22x22/apps/im-zephyr.png has changed
--- a/libpurple/protocols/zephyr/resources/icons/22x22/apps/scalable/im-zephyr.svg Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- sodipodi:docbase="/home/hbons/Desktop/Gaim Refresh/protocols"
- sodipodi:docname="zephyr.svg"
- inkscape:export-filename="/home/hbons/Desktop/Gaim Refresh/protocols/zephyr.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- inkscape:collect="always"
- id="linearGradient4280">
- style="stop-color:#204a87"
- style="stop-color:#3465a4;stop-opacity:0;"
- inkscape:collect="always"
- id="linearGradient3150">
- style="stop-color:#2e3436;stop-opacity:1;"
- style="stop-color:#2e3436;stop-opacity:0;"
- inkscape:collect="always"
- xlink:href="#linearGradient3150"
- id="radialGradient3156"
- gradientTransform="matrix(-0.842757,5.698892e-16,-4.565819e-9,-0.35721,19.80716,14.19321)"
- gradientUnits="userSpaceOnUse" />
- inkscape:collect="always"
- xlink:href="#linearGradient4280"
- id="linearGradient4290"
- gradientUnits="userSpaceOnUse" />
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="23.791015"
- inkscape:cx="14.739163"
- inkscape:cy="14.326547"
- inkscape:current-layer="layer1"
- inkscape:grid-bbox="true"
- inkscape:document-units="px"
- inkscape:guide-bbox="true"
- inkscape:window-width="1268"
- inkscape:window-height="971"
- inkscape:window-y="21" />
- <dc:format>image/svg+xml</dc:format>
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- style="opacity:0;fill:none;fill-opacity:1;stroke:#a40000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.00000048;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 5.5,2.5 L 5.5,6.5 L 15.5,6.5 L 15.5,8.5 L 18.5,8.5 L 18.5,6.5 L 18.5,5.5 L 18.5,2.5 L 5.5,2.5 z M 9.5,9.5625 L 9.5,12.5 L 14.5,12.5 L 14.5,9.5625 L 9.5,9.5625 z M 5.5,13.5 L 5.5,16.5 L 5.5,19.5 L 18.5,19.5 L 18.5,15.5 L 8.5,15.5 L 8.5,13.5 L 5.5,13.5 z "
- style="opacity:0.6;fill:url(#radialGradient3156);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:cx="10.748654"
- sodipodi:cy="10.457643"
- sodipodi:rx="6.6449099"
- sodipodi:ry="2.3675451"
- d="M 17.393564 10.457643 A 6.6449099 2.3675451 0 1 1 4.1037445,10.457643 A 6.6449099 2.3675451 0 1 1 17.393564 10.457643 z"
- transform="matrix(1.730648,0,0,1.300982,-7.102138,5.314662)" />
- style="opacity:1;fill:url(#linearGradient4290);fill-opacity:1.0;stroke:#204a87;stroke-width:1.00000048;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 5.5,2.5 L 5.5,6.5 L 15.5,6.5 L 15.5,8.5 L 18.5,8.5 L 18.5,6.5 L 18.5,5.5 L 18.5,2.5 L 5.5,2.5 z M 9.5,9.5625 L 9.5,12.5 L 14.5,12.5 L 14.5,9.5625 L 9.5,9.5625 z M 5.5,13.5 L 5.5,16.5 L 5.5,19.5 L 18.5,19.5 L 18.5,15.5 L 8.5,15.5 L 8.5,13.5 L 5.5,13.5 z "
- sodipodi:type="inkscape:offset"
- inkscape:radius="-0.9828251"
- inkscape:original="M 5.5 2.5 L 5.5 6.5 L 15.5 6.5 L 15.5 8.5 L 18.5 8.5 L 18.5 6.5 L 18.5 5.5 L 18.5 2.5 L 5.5 2.5 z M 9.5 9.5625 L 9.5 12.5 L 14.5 12.5 L 14.5 9.5625 L 9.5 9.5625 z M 5.5 13.5 L 5.5 16.5 L 5.5 19.5 L 18.5 19.5 L 18.5 15.5 L 8.5 15.5 L 8.5 13.5 L 5.5 13.5 z "
- style="opacity:0.15;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.00000048;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- inkscape:href="#rect4229"
- d="M 6.46875,3.46875 L 6.46875,5.53125 L 15.5,5.53125 C 16.03184,5.5388652 16.461135,5.9681604 16.46875,6.5 L 16.46875,7.53125 L 17.53125,7.53125 L 17.53125,6.5 L 17.53125,5.5 L 17.53125,3.46875 L 6.46875,3.46875 z M 10.46875,10.53125 L 10.46875,11.53125 L 13.53125,11.53125 L 13.53125,10.53125 L 10.46875,10.53125 z M 6.46875,14.46875 L 6.46875,16.5 L 6.46875,18.53125 L 17.53125,18.53125 L 17.53125,16.46875 L 8.5,16.46875 C 7.9681604,16.461135 7.5388652,16.03184 7.53125,15.5 L 7.53125,14.46875 L 6.46875,14.46875 z " />
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.99999881;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
Binary file libpurple/protocols/zephyr/resources/icons/48x48/apps/im-zephyr.png has changed
--- a/libpurple/protocols/zephyr/resources/icons/scalable/apps/im-zephyr.svg Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- sodipodi:docbase="/home/hbons/Desktop/Gaim Refresh/protocols/48"
- sodipodi:docname="zephyr.svg"
- inkscape:export-filename="/home/hbons/Desktop/Gaim Refresh/protocols/48/zephyr.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- inkscape:collect="always"
- id="linearGradient2236">
- style="stop-color:#ffffff;stop-opacity:1;"
- style="stop-color:#ffffff;stop-opacity:0;"
- inkscape:collect="always"
- id="linearGradient3150">
- style="stop-color:#2e3436;stop-opacity:1;"
- style="stop-color:#2e3436;stop-opacity:0;"
- inkscape:collect="always"
- xlink:href="#linearGradient3150"
- id="radialGradient3156"
- gradientTransform="matrix(-0.842757,5.698892e-16,-4.565819e-9,-0.35721,19.80716,14.19321)"
- gradientUnits="userSpaceOnUse" />
- inkscape:collect="always"
- xlink:href="#linearGradient2236"
- id="radialGradient2244"
- gradientTransform="matrix(1.918832,-3.053611e-32,3.873765e-32,2.434201,-22.9708,-29.40113)"
- gradientUnits="userSpaceOnUse" />
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="12.749289"
- inkscape:cx="42.013094"
- inkscape:cy="29.955991"
- inkscape:current-layer="layer1"
- inkscape:grid-bbox="true"
- inkscape:document-units="px"
- inkscape:guide-bbox="true"
- inkscape:window-width="1268"
- inkscape:window-height="971"
- inkscape:window-y="21" />
- <dc:format>image/svg+xml</dc:format>
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- style="opacity:0;fill:none;fill-opacity:1;stroke:#a40000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- style="opacity:0.6;fill:url(#radialGradient3156);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- sodipodi:cx="10.748654"
- sodipodi:cy="10.457643"
- sodipodi:rx="6.6449099"
- sodipodi:ry="2.3675451"
- d="M 17.393564 10.457643 A 6.6449099 2.3675451 0 1 1 4.1037445,10.457643 A 6.6449099 2.3675451 0 1 1 17.393564 10.457643 z"
- transform="matrix(3.23556,0,0,2.111892,-10.27791,16.9144)" />
- style="opacity:1;fill:#3465a4;fill-opacity:1;stroke:#204a87;stroke-width:1.00000048;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 11.5,6.4993337 L 11.5,14.499492 L 32.553687,14.499492 L 32.553687,18.499569 L 38.479829,18.499569 L 38.479829,7.5185793 L 38.479829,6.4993337 L 11.5,6.4993337 z M 19.552827,20.546173 L 19.552827,26.499725 L 30.471849,26.499725 L 30.471849,20.546173 L 19.552827,20.546173 z M 11.5,28.499765 L 11.5,40.5 L 38.485458,40.5 L 38.485458,32.499843 L 17.510207,32.499843 L 17.510207,28.499765 L 11.5,28.499765 z "
- sodipodi:nodetypes="cccccccccccccccccccc" />
- sodipodi:type="inkscape:offset"
- inkscape:radius="-0.9828251"
- inkscape:original="M 11.5 6.5 L 11.5 14.5 L 32.5625 14.5 L 32.5625 18.5 L 38.46875 18.5 L 38.46875 7.53125 L 38.46875 6.5 L 11.5 6.5 z M 19.5625 20.53125 L 19.5625 26.5 L 30.46875 26.5 L 30.46875 20.53125 L 19.5625 20.53125 z M 11.5 28.5 L 11.5 40.5 L 38.5 40.5 L 38.5 32.5 L 17.5 32.5 L 17.5 28.5 L 11.5 28.5 z "
- style="opacity:0.3;fill:url(#radialGradient2244);fill-opacity:1;stroke:#ffffff;stroke-width:1.00000048;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- inkscape:href="#rect4229"
- d="M 12.46875,4.46875 L 12.46875,10.53125 L 32.5625,10.53125 C 33.09434,10.538865 33.523635,10.96816 33.53125,11.5 L 33.53125,14.53125 L 37.5,14.53125 L 37.5,4.53125 L 37.5,4.46875 L 12.46875,4.46875 z M 20.53125,18.5 L 20.53125,22.53125 L 29.5,22.53125 L 29.5,18.5 L 20.53125,18.5 z M 12.46875,26.46875 L 12.46875,36.53125 L 37.53125,36.53125 L 37.53125,30.46875 L 17.5,30.46875 C 16.96816,30.461135 16.538865,30.03184 16.53125,29.5 L 16.53125,26.46875 L 12.46875,26.46875 z " />
--- a/libpurple/protocols/zephyr/resources/zephyr.gresource.xml Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <gresource prefix="/im/pidgin/libpurple/zephyr">
- <file>icons/16x16/apps/im-zephyr.png</file>
- <file>icons/16x16/apps/scalable/im-zephyr.svg</file>
- <file>icons/22x22/apps/im-zephyr.png</file>
- <file>icons/22x22/apps/scalable/im-zephyr.svg</file>
- <file>icons/48x48/apps/im-zephyr.png</file>
- <file>icons/scalable/apps/im-zephyr.svg</file>
--- a/libpurple/protocols/zephyr/sysdep.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains system-dependent header code.
- * Created by: Greg Hudson
- * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-#ifndef PURPLE_ZEPHYR_SYSDEP_H
-#define PURPLE_ZEPHYR_SYSDEP_H
-/* Exit status handling and wait(). */
-# ifdef HAVE_SYS_FILIO_H
-/* Kerberos compatibility. */
-#ifdef ZEPHYR_USES_KERBEROS
-#endif /* ZEPHYR_USES_KERBEROS */
-#ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#ifdef HAVE_SYS_MSGBUF_H
-#endif /* PURPLE_ZEPHYR_SYSDEP_H */
--- a/libpurple/protocols/zephyr/zephyr.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1876 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
- * Copyright (C) 1998-2001, Mark Spencer <markster@marko.net>
- * Some code borrowed from GtkZephyr, by
- * Jag/Sean Dilda <agrajag@linuxpower.org>/<smdilda@unity.ncsu.edu>
- * http://gtkzephyr.linuxpower.org/
- * Some code borrowed from kzephyr, by
- * Chris Colohan <colohan+@cs.cmu.edu>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#include <glib/gi18n-lib.h>
-#include <glib/gstdio.h>
-#include <gplugin-native.h>
-#include "zephyr_account.h"
-#include "zephyr_html.h"
-#include "zephyr_zeph02.h"
-#define ZEPHYR_FALLBACK_CHARSET "ISO-8859-1"
-/* these are deliberately high, since most people don't send multiple "PING"s */
-#define ZEPHYR_TYPING_SEND_TIMEOUT 15
-#define ZEPHYR_TYPING_RECV_TIMEOUT 10
-static PurpleProtocol *my_protocol = NULL;
-static GSList *cmds = NULL;
-extern char __Zephyr_realm[];
-typedef struct _zephyr_triple zephyr_triple;
-typedef gboolean (*ZephyrLoginFunc)(zephyr_account *zephyr);
-struct _ZephyrProtocol {
-extern const char *username;
-static void zephyr_chat_set_topic(PurpleConnection *gc, int id, const char *topic);
-zephyr_strip_local_realm(const zephyr_account *zephyr, const char *user)
- Takes in a username of the form username or username@realm
- username, if there is no realm, or the realm is the local realm
- username@realm if there is a realm and it is foreign
- char *at = strchr(user, '@');
- if (at && !g_ascii_strcasecmp(at+1,zephyr->realm)) {
- /* We're passed in a username of the form user@users-realm */
- return g_strndup(user, at - user);
- /* We're passed in a username of the form user or user@foreign-realm */
-zephyr_triple_new(zephyr_account *zephyr, const ZSubscription_t *sub)
- zt = g_new0(zephyr_triple, 1);
- zt->sub.zsub_class = g_strdup(sub->zsub_class);
- zt->sub.zsub_classinst = g_strdup(sub->zsub_classinst);
- zt->sub.zsub_recipient = g_strdup(sub->zsub_recipient);
- zt->name = g_strdup_printf("%s,%s,%s", sub->zsub_class,
- sub->zsub_classinst ? sub->zsub_classinst : "",
- sub->zsub_recipient ? sub->zsub_recipient : "");
- zt->id = ++(zephyr->last_id);
-zephyr_triple_free(zephyr_triple *zt)
- g_free(zt->sub.zsub_class);
- g_free(zt->sub.zsub_classinst);
- g_free(zt->sub.zsub_recipient);
-/* returns 0 if sub is a subset of zt.sub. This function is used to
- determine whether a zephyr sent to sub should be placed in the chat
- sub is a subset of zt.sub
- iff. the classnames are identical ignoring case
- AND. the instance names are identical (ignoring case), or zt.sub->instance is *.
- AND. the recipient names are identical
-zephyr_triple_subset(const zephyr_triple *zt, const ZSubscription_t *sub)
- if (!sub->zsub_class) {
- purple_debug_error("zephyr", "sub1c doesn't exist\n");
- if (!sub->zsub_classinst) {
- purple_debug_error("zephyr", "sub1i doesn't exist\n");
- if (!sub->zsub_recipient) {
- purple_debug_error("zephyr", "sub1r doesn't exist\n");
- if (!zt->sub.zsub_class) {
- purple_debug_error("zephyr", "sub2c doesn't exist\n");
- if (!zt->sub.zsub_classinst) {
- purple_debug_error("zephyr", "sub2i doesn't exist\n");
- if (!zt->sub.zsub_recipient) {
- purple_debug_error("zephyr", "sub2r doesn't exist\n");
- if (g_ascii_strcasecmp(zt->sub.zsub_class, sub->zsub_class)) {
- if (g_ascii_strcasecmp(zt->sub.zsub_classinst, sub->zsub_classinst) && g_ascii_strcasecmp(zt->sub.zsub_classinst, "*")) {
- if (g_ascii_strcasecmp(zt->sub.zsub_recipient, sub->zsub_recipient)) {
- purple_debug_info("zephyr", "<%s,%s,%s> is in <%s,%s,%s>\n",
- sub->zsub_class, sub->zsub_classinst, sub->zsub_recipient,
- zt->sub.zsub_class, zt->sub.zsub_classinst, zt->sub.zsub_recipient);
- Converts strings to utf-8 if necessary using user specified encoding
-convert_to_utf8(const gchar *string, const gchar *from_encoding)
- if (g_utf8_validate(string, -1, NULL)) {
- return g_strdup(string);
- utf8 = g_convert(string, -1, "UTF-8", from_encoding, NULL, NULL, &err);
- purple_debug_error("zephyr", "recv conversion error: %s\n", err->message);
- utf8 = g_strdup(_("(There was an error converting this message. Check the 'Encoding' option in the Account Editor)"));
-pending_zloc(zephyr_account *zephyr, const char *who)
- char* normalized_who = zephyr_normalize_local_realm(zephyr, who);
- curr = g_list_find_custom(zephyr->pending_zloc_names, normalized_who, (GCompareFunc)g_ascii_strcasecmp);
- g_free(normalized_who);
- g_free((char *)curr->data);
- zephyr->pending_zloc_names = g_list_delete_link(zephyr->pending_zloc_names, curr);
-find_buddy(const zephyr_account *zephyr, const char *user)
- PurpleBuddy *buddy = purple_blist_find_buddy(zephyr->account, user);
- char *stripped_user = zephyr_strip_local_realm(zephyr, user);
- buddy = purple_blist_find_buddy(zephyr->account, stripped_user);
-zephyr_triple_open(zephyr_triple *zt, PurpleConnection *gc, const char *instance)
- purple_serv_got_joined_chat(gc, zt->id, zt->name);
- zephyr_chat_set_topic(gc, zt->id, instance);
-handle_message(PurpleConnection *gc, ZNotice_t *notice)
- zephyr_account* zephyr = purple_connection_get_protocol_data(gc);
- if (!g_ascii_strcasecmp(notice->z_class, LOGIN_CLASS)) {
- /* well, we'll be updating in 20 seconds anyway, might as well ignore this. */
- } else if (!g_ascii_strcasecmp(notice->z_class, LOCATE_CLASS)) {
- if (!g_ascii_strcasecmp(notice->z_opcode, LOCATE_LOCATE)) {
- /* XXX add real error reporting */
- if (ZParseLocations(notice, NULL, &nlocs, &user) != ZERR_NONE)
- handle_locations(gc, user, nlocs, NULL);
- int signature_length = strlen(notice->z_message);
- /* Need to deal with 0 length messages to handle typing notification (OPCODE) ping messages */
- /* One field zephyrs would have caused purple to crash */
- if ((notice->z_message_len == 0) || (notice->z_message_len <= (signature_length + 1))) {
- char *ptr = (char *) notice->z_message + (signature_length + 1);
- len = notice->z_message_len - (signature_length + 1);
- tmpbuf = g_malloc(len + 1);
- g_snprintf(tmpbuf, len + 1, "%s", ptr);
- tmpescape = g_markup_escape_text(tmpbuf, -1);
- tmpbuf = zephyr_to_html(tmpescape);
- buf = convert_to_utf8(tmpbuf, zephyr->encoding);
- purple_debug_info("zephyr", "message_size %d %d %d", len, notice->z_message_len, signature_length);
- stripped_sender = zephyr_strip_local_realm(zephyr, notice->z_sender);
- if (!g_ascii_strcasecmp(notice->z_class, "MESSAGE") &&
- !g_ascii_strcasecmp(notice->z_class_inst, "PERSONAL") &&
- !g_ascii_strcasecmp(notice->z_recipient, zephyr->username)) {
- PurpleMessageFlags flags = 0;
- if (!g_ascii_strcasecmp(notice->z_message, "Automated reply:"))
- flags |= PURPLE_MESSAGE_AUTO_RESP;
- if (!g_ascii_strcasecmp(notice->z_opcode, "PING"))
- purple_serv_got_typing(gc,stripped_sender,ZEPHYR_TYPING_RECV_TIMEOUT, PURPLE_IM_TYPING);
- purple_serv_got_im(gc, stripped_sender, buf, flags, time(NULL));
- ZSubscription_t sub = {
- .zsub_class = notice->z_class,
- .zsub_classinst = (gchar *)notice->z_class_inst,
- .zsub_recipient = (gchar *)notice->z_recipient
- GSList *l = g_slist_find_custom(zephyr->subscrips, &sub, (GCompareFunc)zephyr_triple_subset);
- PurpleConversation *gcc;
- PurpleConversationManager *manager;
- /* This is a server supplied subscription */
- zt = zephyr_triple_new(zephyr, &sub);
- zephyr->subscrips = g_slist_append(zephyr->subscrips, zt);
- zephyr_triple_open(zt, gc, notice->z_class_inst);
- if (!g_ascii_strcasecmp(notice->z_class_inst, "PERSONAL"))
- send_inst_utf8 = g_strdup(stripped_sender);
- char *send_inst = g_strdup_printf("[%s] %s", notice->z_class_inst, stripped_sender);
- send_inst_utf8 = convert_to_utf8(send_inst, zephyr->encoding);
- purple_debug_error("zephyr","Failed to convert instance for sender %s.\n", stripped_sender);
- send_inst_utf8 = g_strdup(stripped_sender);
- manager = purple_conversation_manager_get_default();
- gcc = purple_conversation_manager_find_chat(manager,
- purple_connection_get_account(gc),
- if (!purple_chat_conversation_has_user(PURPLE_CHAT_CONVERSATION(gcc), stripped_sender)) {
- GInetAddress *inet_addr = NULL;
- inet_addr = g_inet_address_new_from_bytes(
- (const guint8 *)¬ice->z_sender_addr,
- ipaddr = g_inet_address_to_string(inet_addr);
- purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(gcc),
- stripped_sender, ipaddr,
- PURPLE_CHAT_USER_NONE, TRUE);
- g_object_unref(inet_addr);
- purple_serv_got_chat_in(gc, zt->id, send_inst_utf8,
- PURPLE_MESSAGE_RECV, buf, time(NULL));
- g_free(send_inst_utf8);
- g_free(stripped_sender);
-handle_locations(PurpleConnection *gc, const gchar *user, int nlocs, const ZLocations_t *zloc)
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- b = find_buddy(zephyr, user);
- bname = b ? purple_buddy_get_name(b) : NULL;
- name = b ? bname : user;
- if ((b && pending_zloc(zephyr, bname)) || pending_zloc(zephyr, user)) {
- PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
- /* TODO: Check whether it's correct to call add_pair_html,
- or if we should be using add_pair_plaintext */
- purple_notify_user_info_add_pair_html(user_info, _("User"), name);
- balias = b ? purple_buddy_get_local_alias(b) : NULL;
- purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias);
- purple_notify_user_info_add_pair_plaintext(user_info, NULL, _("Hidden or not logged-in"));
- for (; nlocs > 0; nlocs--) {
- /* XXX add real error reporting */
- ZGetLocations(&locs, &one);
- /* TODO: Need to escape locs.host and locs.time? */
- tmp = g_strdup_printf(_("<br>At %s since %s"), locs.host, locs.time);
- purple_notify_user_info_add_pair_html(user_info, _("Location"), tmp);
- purple_notify_userinfo(gc, name, user_info, NULL, NULL);
- purple_notify_user_info_destroy(user_info);
- purple_protocol_got_user_status(zephyr->account, name, (nlocs > 0) ? "available" : "offline", NULL);
-check_loc_buddy(PurpleBuddy *buddy, zephyr_account *zephyr)
- const char *bname = purple_buddy_get_name(buddy);
- char *chk = zephyr_normalize_local_realm(zephyr, bname);
- ZLocateUser(chk, &numlocs, ZAUTH);
- for (int i = 0; i < numlocs; i++) {
- ZLocations_t locations;
- ZGetLocations(&locations, &one);
- purple_protocol_got_user_status(zephyr->account, bname, "available",
- purple_protocol_got_user_idle(zephyr->account, bname, FALSE, 0);
- purple_debug_info("zephyr", "chk: %s, bname: %s", chk, bname);
- /* 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);
-check_loc(gpointer data)
- zephyr_account *zephyr = (zephyr_account *)data;
- GSList *buddies = purple_blist_find_buddies(zephyr->account, NULL);
- g_slist_foreach(buddies, (GFunc)check_loc_buddy, zephyr);
- return G_SOURCE_CONTINUE;
-get_exposure_level(void)
- /* XXX add real error reporting */
- const gchar *exposure = ZGetVariable("exposure");
- if (!g_ascii_strcasecmp(exposure, EXPOSE_NONE)) {
- if (!g_ascii_strcasecmp(exposure, EXPOSE_OPSTAFF)) {
- if (!g_ascii_strcasecmp(exposure, EXPOSE_REALMANN)) {
- return EXPOSE_REALMANN;
- if (!g_ascii_strcasecmp(exposure, EXPOSE_NETVIS)) {
- if (!g_ascii_strcasecmp(exposure, EXPOSE_NETANN)) {
- return EXPOSE_REALMVIS;
-static void strip_comments(char *str)
- char *tmp = strchr(str, '#');
-static void zephyr_inithosts(zephyr_account *zephyr)
- /* XXX This code may not be Win32 clean */
- zephyr->ourhost = g_strdup(g_get_host_name());
- if (!(hent = gethostbyname(zephyr->ourhost))) {
- purple_debug_error("zephyr",
- "unable to resolve hostname, %%canon%% will be "
- "wrong in subscriptions and has been set to the "
- "value of %%host%%, %s",
- zephyr->ourhostcanon = g_strdup(zephyr->ourhost);
- zephyr->ourhostcanon = g_strdup(hent->h_name);
-static void process_zsubs(zephyr_account *zephyr)
- /* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and
- registers (subscribes to) them on the server */
- /* XXX deal with unsubscriptions */
- /* XXX deal with punts */
- fname = g_strdup_printf("%s/.zephyr.subs", purple_home_dir());
- f = g_fopen(fname, "r");
- while (fgets(buff, BUFSIZ, f)) {
- triple = g_strsplit(buff, ",", 3);
- if (triple[0] && triple[1]) {
- char *tmp = g_strdup(zephyr->username);
- if (triple[2] == NULL) {
- sub.zsub_recipient = g_malloc0(1);
- } else if (!g_ascii_strcasecmp(triple[2], "%me%")) {
- sub.zsub_recipient = g_strdup(zephyr->username);
- } else if (!g_ascii_strcasecmp(triple[2], "*")) {
- * form of class,instance,* */
- sub.zsub_recipient = g_malloc0(1);
- } else if (!g_ascii_strcasecmp(triple[2], tmp)) {
- /* form of class,instance,aatharuv@ATHENA.MIT.EDU */
- sub.zsub_recipient = g_strdup(triple[2]);
- } else if ((atptr = strchr(triple[2], '@')) != NULL) {
- /* form of class,instance,*@ANDREW.CMU.EDU
- * class,instance,@ANDREW.CMU.EDU
- * If realm is local realm, blank recipient, else
- char *realmat = g_strdup_printf("@%s",zephyr->realm);
- if (!g_ascii_strcasecmp(atptr, realmat)) {
- sub.zsub_recipient = g_malloc0(1);
- sub.zsub_recipient = g_strdup(atptr);
- sub.zsub_recipient = g_strdup(triple[2]);
- if (!g_ascii_strcasecmp(triple[0], "%host%")) {
- sub.zsub_class = g_strdup(zephyr->ourhost);
- } else if (!g_ascii_strcasecmp(triple[0], "%canon%")) {
- sub.zsub_class = g_strdup(zephyr->ourhostcanon);
- sub.zsub_class = g_strdup(triple[0]);
- if (!g_ascii_strcasecmp(triple[1], "%host%")) {
- sub.zsub_classinst = g_strdup(zephyr->ourhost);
- } else if (!g_ascii_strcasecmp(triple[1], "%canon%")) {
- sub.zsub_classinst = g_strdup(zephyr->ourhostcanon);
- sub.zsub_classinst = g_strdup(triple[1]);
- /* There should be some sort of error report listing classes that couldn't be subbed to.
- Not important right now though */
- if (!zephyr->subscribe_to(zephyr, &sub)) {
- purple_debug_error("zephyr", "Couldn't subscribe to %s, %s, %s\n",
- sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient);
- zephyr->subscrips = g_slist_append(zephyr->subscrips, zephyr_triple_new(zephyr, &sub));
- g_free(sub.zsub_class);
- g_free(sub.zsub_classinst);
- g_free(sub.zsub_recipient);
-process_anyone(const zephyr_account *zephyr)
- gchar buff[BUFSIZ], *filename;
- if (!(g = purple_blist_find_group(_("Anyone")))) {
- g = purple_group_new(_("Anyone"));
- purple_blist_add_group(g, NULL);
- filename = g_strconcat(purple_home_dir(), "/.anyone", NULL);
- if ((fd = g_fopen(filename, "r")) != NULL) {
- while (fgets(buff, BUFSIZ, fd)) {
- if (*buff && !find_buddy(zephyr, buff)) {
- char *stripped_user = zephyr_strip_local_realm(zephyr, buff);
- purple_debug_info("zephyr", "stripped_user %s\n", stripped_user);
- b = purple_buddy_new(zephyr->account, stripped_user, NULL);
- purple_blist_add_buddy(b, NULL, g, NULL);
-get_zephyr_exposure(PurpleAccount *account)
- exposure = purple_account_get_string(account, "exposure_level", EXPOSE_REALMVIS);
- /* Make sure that the exposure (visibility) is set to a sane value */
- exp2 = g_strstrip(g_ascii_strup(exposure, -1));
- if (purple_strequal(exp2, EXPOSE_NONE) ||
- purple_strequal(exp2, EXPOSE_OPSTAFF) ||
- purple_strequal(exp2, EXPOSE_REALMANN) ||
- purple_strequal(exp2, EXPOSE_NETVIS) ||
- purple_strequal(exp2, EXPOSE_NETANN)) {
- return g_strdup(EXPOSE_REALMVIS);
-get_zephyr_realm(PurpleAccount *account, const gchar *local_realm)
- const char *realm = purple_account_get_string(account, "realm", "");
- g_strlcpy(__Zephyr_realm, realm, REALM_SZ - 1);
- return g_strdup(realm);
-zephyr_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
- zephyr_account *zephyr;
- GSourceFunc check_notify;
- gc = purple_account_get_connection(account);
- username = purple_account_get_username(account);
- purple_connection_set_flags(gc, PURPLE_CONNECTION_FLAG_AUTO_RESP |
- PURPLE_CONNECTION_FLAG_HTML | PURPLE_CONNECTION_FLAG_NO_BGCOLOR |
- PURPLE_CONNECTION_FLAG_NO_URLDESC | PURPLE_CONNECTION_FLAG_NO_IMAGES);
- zephyr = g_new0(zephyr_account, 1);
- purple_connection_set_protocol_data(gc, zephyr);
- zephyr->account = account;
- zephyr->exposure = get_zephyr_exposure(account);
- if (purple_account_get_bool(account, "use_tzc", FALSE)) {
- zephyr->connection_type = PURPLE_ZEPHYR_TZC;
- check_notify = tzc_check_notify;
- zephyr->subscribe_to = tzc_subscribe_to;
- zephyr->request_locations = tzc_request_locations;
- zephyr->send_message = tzc_send_message;
- zephyr->set_location = tzc_set_location;
- zephyr->get_subs_from_server = tzc_get_subs_from_server;
- zephyr->close = tzc_close;
- zephyr->connection_type = PURPLE_ZEPHYR_KRB4;
- check_notify = zeph02_check_notify;
- zephyr->subscribe_to = zeph02_subscribe_to;
- zephyr->request_locations = zeph02_request_locations;
- zephyr->send_message = zeph02_send_message;
- zephyr->set_location = zeph02_set_location;
- zephyr->get_subs_from_server = zeph02_get_subs_from_server;
- zephyr->close = zeph02_close;
- zephyr->encoding = (char *)purple_account_get_string(account, "encoding", ZEPHYR_FALLBACK_CHARSET);
- purple_debug_info("zephyr","does it get here\n");
- purple_debug_info("zephyr"," realm: %s username:%s\n", zephyr->realm, zephyr->username);
- zephyr->krbtkfile = NULL;
- zephyr_inithosts(zephyr);
- sub.zsub_class = "MESSAGE";
- sub.zsub_classinst = "PERSONAL";
- sub.zsub_recipient = zephyr->username;
- if (!zephyr->subscribe_to(zephyr, &sub)) {
- /* XXX don't translate this yet. It could be written better */
- /* XXX error messages could be handled with more detail */
- purple_notify_error(gc, NULL,
- "Unable to subscribe to messages", "Unable to subscribe to initial messages",
- purple_request_cpar_from_connection(gc));
- purple_connection_set_state(gc, PURPLE_CONNECTION_STATE_CONNECTED);
- if (purple_account_get_bool(account, "read_anyone", TRUE)) {
- process_anyone(zephyr);
- if (purple_account_get_bool(account, "read_zsubs", TRUE)) {
- zephyr->nottimer = g_timeout_add(100, check_notify, gc);
- zephyr->loctimer = g_timeout_add_seconds(20, check_loc, zephyr);
-static void write_zsubs(zephyr_account *zephyr)
- /* Exports subscription (chat) list back to
- * XXX deal with %host%, %canon%, unsubscriptions, and negative subscriptions (punts?)
- GSList *s = zephyr->subscrips;
- fname = g_strdup_printf("%s/.zephyr.subs", purple_home_dir());
- fd = g_fopen(fname, "w");
- char *zclass, *zinst, *zrecip;
- triple = g_strsplit(zt->name, ",", 3);
- /* deal with classes */
- if (!g_ascii_strcasecmp(triple[0],zephyr->ourhost)) {
- zclass = g_strdup("%host%");
- } else if (!g_ascii_strcasecmp(triple[0],zephyr->ourhostcanon)) {
- zclass = g_strdup("%canon%");
- zclass = g_strdup(triple[0]);
- /* deal with instances */
- if (!g_ascii_strcasecmp(triple[1],zephyr->ourhost)) {
- zinst = g_strdup("%host%");
- } else if (!g_ascii_strcasecmp(triple[1],zephyr->ourhostcanon)) {
- zinst = g_strdup("%canon%");;
- zinst = g_strdup(triple[1]);
- /* deal with recipients */
- if (triple[2] == NULL) {
- zrecip = g_strdup("*");
- } else if (!g_ascii_strcasecmp(triple[2],"")){
- zrecip = g_strdup("*");
- } else if (!g_ascii_strcasecmp(triple[2], zephyr->username)) {
- zrecip = g_strdup("%me%");
- zrecip = g_strdup(triple[2]);
- fprintf(fd, "%s,%s,%s\n",zclass,zinst,zrecip);
-static void write_anyone(zephyr_account *zephyr)
- PurpleAccount *account;
- fname = g_strdup_printf("%s/.anyone", purple_home_dir());
- fd = g_fopen(fname, "w");
- account = zephyr->account;
- for (buddies = purple_blist_find_buddies(account, NULL); buddies;
- buddies = g_slist_delete_link(buddies, buddies)) {
- PurpleBuddy *b = buddies->data;
- gchar *stripped_user = zephyr_strip_local_realm(zephyr, purple_buddy_get_name(b));
- fprintf(fd, "%s\n", stripped_user);
-zephyr_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection * gc) {
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- g_list_free_full(zephyr->pending_zloc_names, g_free);
- if (purple_account_get_bool(purple_connection_get_account(gc), "write_anyone", FALSE))
- if (purple_account_get_bool(purple_connection_get_account(gc), "write_zsubs", FALSE))
- g_slist_free_full(zephyr->subscrips, (GDestroyNotify)zephyr_triple_free);
- g_source_remove(zephyr->nottimer);
- g_source_remove(zephyr->loctimer);
- g_clear_pointer(&zephyr->ourhost, g_free);
- g_clear_pointer(&zephyr->ourhostcanon, g_free);
-zephyr_send_message(zephyr_account *zephyr, gchar *zclass, gchar *instance,
- gchar *recipient, const gchar *im, const gchar *sig,
- /* (From the tzc source)
- * emacs sends something of the form:
- * (recipients ("PERSONAL" . "bovik") ("test" . ""))
- * (message . ("Harry Bovik" "my zgram"))
- tmp_buf = html_to_zephyr(im);
- html_buf = purple_unescape_html(tmp_buf);
- result = zephyr->send_message(zephyr, zclass, instance, recipient, html_buf, sig, opcode);
-zephyr_triple_cmp_id(gconstpointer data, gconstpointer user_data)
- const zephyr_triple *zt = data;
- int id = GPOINTER_TO_INT(user_data);
-static const char * zephyr_get_signature(void)
- /* XXX add zephyr error reporting */
- const char * sig =ZGetVariable("zwrite-signature");
- sig = g_get_real_name();
-zephyr_chat_send(PurpleProtocolChat *protocol_chat, PurpleConnection *gc,
- int id, PurpleMessage *msg)
- PurpleConversation *gcc;
- PurpleConversationManager *manager;
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- l = g_slist_find_custom(zephyr->subscrips, GINT_TO_POINTER(id), zephyr_triple_cmp_id);
- /* this should never happen. */
- sig = zephyr_get_signature();
- manager = purple_conversation_manager_get_default();
- gcc = purple_conversation_manager_find_chat(manager,
- purple_connection_get_account(gc),
- if (!(inst = (char *)purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(gcc))))
- inst = g_strdup("PERSONAL");
- if (!g_ascii_strcasecmp(zt->sub.zsub_recipient, "*")) {
- recipient = zephyr_normalize_local_realm(zephyr, "");
- recipient = zephyr_normalize_local_realm(zephyr, zt->sub.zsub_recipient);
- zephyr_send_message(zephyr, zt->sub.zsub_class, inst, recipient,
- purple_message_get_contents(msg), sig, "");
-static int zephyr_send_im(PurpleProtocolIM *im, PurpleConnection *gc, PurpleMessage *msg)
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if (purple_message_get_flags(msg) & PURPLE_MESSAGE_AUTO_RESP) {
- sig = "Automated reply:";
- sig = zephyr_get_signature();
- zephyr_send_message(zephyr, "MESSAGE", "PERSONAL",
- zephyr_normalize_local_realm(zephyr, purple_message_get_recipient(msg)),
- purple_message_get_contents(msg), sig, "");
-/* Basically the inverse of zephyr_strip_local_realm */
-zephyr_normalize_local_realm(const zephyr_account *zephyr, const char *orig)
- if (*orig == '\0' || strchr(orig, '@')) {
- return g_strdup_printf("%s@%s", orig, zephyr->realm);
-zephyr_normalize(PurpleProtocolClient *client, PurpleAccount *account,
- static char buf[BUF_LEN];
- if (strlen(who) >= sizeof(buf))
- gc = purple_account_get_connection((PurpleAccount *)account);
- tmp = zephyr_normalize_local_realm(purple_connection_get_protocol_data(gc), who);
- if (strlen(tmp) >= sizeof(buf)) {
- g_strlcpy(buf, tmp, sizeof(buf));
-zephyr_zloc(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- gchar *normalized_who = zephyr_normalize_local_realm(zephyr, 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 */
- g_free(normalized_who);
-zephyr_set_status(PurpleProtocolServer *protocol_server,
- PurpleAccount *account, PurpleStatus *status)
- PurpleConnection *gc = purple_account_get_connection(account);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- PurpleStatusPrimitive primitive = purple_status_type_get_primitive(purple_status_get_status_type(status));
- if (primitive == PURPLE_STATUS_AWAY) {
- zephyr->away = g_strdup(purple_status_get_attr_string(status,"message"));
- else if (primitive == PURPLE_STATUS_AVAILABLE) {
- zephyr->set_location(zephyr, zephyr->exposure);
- else if (primitive == PURPLE_STATUS_INVISIBLE) {
- /* XXX handle errors */
- zephyr->set_location(zephyr, EXPOSE_OPSTAFF);
-zephyr_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
- PurpleAccount *account)
- PurpleStatusType *type;
- /* zephyr has several exposures
- NONE (where you are hidden, and zephyrs to you are in practice silently dropped -- yes this is wrong)
- REALM-VISIBLE visible to people in local realm
- REALM-ANNOUNCED REALM-VISIBLE+ plus your logins/logouts are announced to <login,username,*>
- NET-VISIBLE REALM-ANNOUNCED, plus visible to people in foreign realm
- NET-ANNOUNCED NET-VISIBLE, plus logins/logouts are announced to <login,username,*>
- Online will set the user to the exposure they have in their options (defaulting to REALM-VISIBLE),
- Hidden, will set the user's exposure to OPSTAFF
- Away won't change their exposure but will set an auto away message (for IMs only)
- type = purple_status_type_new(PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE);
- types = g_list_append(types,type);
- type = purple_status_type_new(PURPLE_STATUS_INVISIBLE, NULL, NULL, TRUE);
- types = g_list_append(types,type);
- type = purple_status_type_new_with_attrs(
- PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE,
- "message", _("Message"), purple_value_new(G_TYPE_STRING),
- types = g_list_append(types, type);
- type = purple_status_type_new(PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE);
- types = g_list_append(types,type);
-zephyr_chat_info(PurpleProtocolChat *protocol_chat, PurpleConnection * gc) {
- PurpleProtocolChatEntry *pce;
- pce = g_new0(PurpleProtocolChatEntry, 1);
- pce->label = _("_Class:");
- pce->identifier = "class";
- m = g_list_append(m, pce);
- pce = g_new0(PurpleProtocolChatEntry, 1);
- pce->label = _("_Instance:");
- pce->identifier = "instance";
- m = g_list_append(m, pce);
- pce = g_new0(PurpleProtocolChatEntry, 1);
- pce->label = _("_Recipient:");
- pce->identifier = "recipient";
- m = g_list_append(m, pce);
-zephyr_get_chat_name(PurpleProtocolChat *protocol_chat, GHashTable *data) {
- gchar* zclass = g_hash_table_lookup(data,"class");
- gchar* inst = g_hash_table_lookup(data,"instance");
- gchar* recipient = g_hash_table_lookup(data, "recipient");
- if (!zclass) /* This should never happen */
- return g_strdup_printf("%s,%s,%s",zclass,inst,recipient);
-zephyr_triple_open_personal(zephyr_triple *zt, PurpleConnection *gc, char *instance)
- if (!g_ascii_strcasecmp(instance, "*")) {
- zephyr_triple_open(zt, gc, instance);
-zephyr_join_chat(PurpleConnection *gc, ZSubscription_t *sub)
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- g_return_if_fail(zephyr != NULL);
- if (!sub->zsub_class) {
- if (!g_ascii_strcasecmp(sub->zsub_class, "%host%")) {
- sub->zsub_class = zephyr->ourhost;
- } else if (!g_ascii_strcasecmp(sub->zsub_class, "%canon%")) {
- sub->zsub_class = zephyr->ourhostcanon;
- if (!sub->zsub_classinst || *sub->zsub_classinst == '\0') {
- sub->zsub_classinst = "*";
- } else if (!g_ascii_strcasecmp(sub->zsub_classinst, "%host%")) {
- sub->zsub_classinst = zephyr->ourhost;
- } else if (!g_ascii_strcasecmp(sub->zsub_classinst, "%canon%")) {
- sub->zsub_classinst = zephyr->ourhostcanon;
- if (!sub->zsub_recipient || *sub->zsub_recipient == '*') {
- sub->zsub_recipient = "";
- } else if (!g_ascii_strcasecmp(sub->zsub_recipient, "%me%")) {
- sub->zsub_recipient = zephyr->username;
- l = g_slist_find_custom(zephyr->subscrips, &sub, (GCompareFunc)zephyr_triple_subset);
- zephyr_triple_open_personal(zt, gc, sub->zsub_classinst);
- if (!zephyr->subscribe_to(zephyr, sub)) {
- /* Called when the server notifies us a message couldn't get sent */
- /* XXX output better subscription information */
- gchar *subscribe_failed = g_strdup_printf(_("Attempt to subscribe to %s,%s,%s failed"),
- sub->zsub_class, sub->zsub_classinst, sub->zsub_recipient);
- purple_notify_error(gc,"", subscribe_failed, NULL, purple_request_cpar_from_connection(gc));
- g_free(subscribe_failed);
- zt = zephyr_triple_new(zephyr, sub);
- zephyr->subscrips = g_slist_append(zephyr->subscrips, zt);
- zephyr_triple_open_personal(zt, gc, sub->zsub_classinst);
-zephyr_protocol_chat_join(PurpleProtocolChat *protocol_chat,
- PurpleConnection *gc, GHashTable * data)
- ZSubscription_t sub = {
- .zsub_class = g_hash_table_lookup(data, "class"),
- .zsub_classinst = g_hash_table_lookup(data, "instance"),
- .zsub_recipient = g_hash_table_lookup(data, "recipient")
- zephyr_join_chat(gc, &sub);
-zephyr_chat_leave(PurpleProtocolChat *protocol_chat, PurpleConnection * gc,
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- l = g_slist_find_custom(zephyr->subscrips, GINT_TO_POINTER(id), zephyr_triple_cmp_id);
- zephyr_triple *zt = l->data;
- zt->id = ++(zephyr->last_id);
-zephyr_find_blist_chat(PurpleProtocolClient *client, PurpleAccount *account,
- PurpleBlistNode *gnode, *cnode;
- /* XXX needs to be %host%,%canon%, and %me% clean */
- for (gnode = purple_blist_get_default_root(); gnode;
- gnode = purple_blist_node_get_sibling_next(gnode)) {
- for(cnode = purple_blist_node_get_first_child(gnode);
- cnode = purple_blist_node_get_sibling_next(cnode)) {
- PurpleChat *chat = (PurpleChat*)cnode;
- const gchar *zclass, *inst, *recip;
- GHashTable *components;
- if(!PURPLE_IS_CHAT(cnode))
- if(purple_chat_get_account(chat) != account)
- components = purple_chat_get_components(chat);
- if(!(zclass = g_hash_table_lookup(components, "class")))
- if(!(inst = g_hash_table_lookup(components, "instance")))
- if(!(recip = g_hash_table_lookup(components, "recipient")))
- /* purple_debug_info("zephyr","in zephyr_find_blist_chat name: %s\n",name?name:""); */
- triple = g_strsplit(name,",",3);
- if (!g_ascii_strcasecmp(triple[0], zclass) &&
- !g_ascii_strcasecmp(triple[1], inst) &&
- !g_ascii_strcasecmp(triple[2], recip)) {
-zephyr_protocol_get_account_options(PurpleProtocol *protocol) {
- PurpleAccountOption *option;
- const gchar *tmp = get_exposure_level();
- option = purple_account_option_bool_new(_("Use tzc"), "use_tzc", FALSE);
- opts = g_list_append(opts, option);
- option = purple_account_option_string_new(_("tzc command"), "tzc_command",
- opts = g_list_append(opts, option);
- option = purple_account_option_bool_new(_("Export to .anyone"),
- "write_anyone", FALSE);
- opts = g_list_append(opts, option);
- option = purple_account_option_bool_new(_("Export to .zephyr.subs"),
- opts = g_list_append(opts, option);
- option = purple_account_option_bool_new(_("Import from .anyone"),
- opts = g_list_append(opts, option);
- option = purple_account_option_bool_new(_("Import from .zephyr.subs"),
- opts = g_list_append(opts, option);
- option = purple_account_option_string_new(_("Realm"), "realm", "");
- opts = g_list_append(opts, option);
- option = purple_account_option_string_new(_("Exposure"), "exposure_level",
- opts = g_list_append(opts, option);
- option = purple_account_option_string_new(_("Encoding"), "encoding",
- ZEPHYR_FALLBACK_CHARSET);
- opts = g_list_append(opts, option);
-zephyr_send_typing(G_GNUC_UNUSED PurpleProtocolIM *im, PurpleConnection *gc, const char *who, PurpleIMTypingState state)
- zephyr_account *zephyr;
- if (state == PURPLE_IM_NOT_TYPING) {
- zephyr = purple_connection_get_protocol_data(gc);
- /* XXX We probably should care if this fails. Or maybe we don't want to */
- purple_debug_info("zephyr", "who is null\n");
- recipient = zephyr_normalize_local_realm(zephyr, "");
- char *comma = strrchr(who, ',');
- /* Don't ping broadcast (chat) recipients */
- /* The strrchr case finds a realm-stripped broadcast subscription
- e.g. comma is the last character in the string */
- if (comma && ((*(comma+1) == '\0') || (*(comma+1) == '@'))) {
- recipient = zephyr_normalize_local_realm(zephyr, who);
- purple_debug_info("zephyr", "about to send typing notification to %s", recipient);
- zephyr_send_message(zephyr, "MESSAGE", "PERSONAL", recipient, "", "", "PING");
- purple_debug_info("zephyr", "sent typing notification\n");
- * TODO: Is this correct? It means we will call
- * purple_serv_send_typing(gc, who, PURPLE_IM_TYPING) once every 15 seconds
- * until the Purple user stops typing.
- return ZEPHYR_TYPING_SEND_TIMEOUT;
-static void zephyr_chat_set_topic(PurpleConnection * gc, int id, const char *topic)
- PurpleConversation *gcc;
- PurpleConversationManager *manager;
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- l = g_slist_find_custom(zephyr->subscrips, GINT_TO_POINTER(id), zephyr_triple_cmp_id);
- manager = purple_conversation_manager_get_default();
- gcc = purple_conversation_manager_find_chat(manager,
- purple_connection_get_account(gc),
- topic_utf8 = convert_to_utf8(topic, zephyr->encoding);
- purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(gcc), zephyr->username, topic_utf8);
-zephyr_protocol_chat_set_topic(PurpleProtocolChat *protocol_chat,
- PurpleConnection *gc, int id, const char *topic)
- zephyr_chat_set_topic(gc, id, topic);
-static PurpleCmdRet zephyr_purple_cmd_msg(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);;
- if (!g_ascii_strcasecmp(args[0],"*"))
- return PURPLE_CMD_RET_FAILED; /* "*" is not a valid argument */
- recipient = zephyr_normalize_local_realm(zephyr, args[0]);
- if (strlen(recipient) < 1) {
- return PURPLE_CMD_RET_FAILED; /* a null recipient is a chat message, not an IM */
- if (zephyr_send_message(zephyr,"MESSAGE","PERSONAL",recipient,args[1],zephyr_get_signature(),""))
- ret = PURPLE_CMD_RET_OK;
- ret = PURPLE_CMD_RET_FAILED;
-static PurpleCmdRet zephyr_purple_cmd_zlocate(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- zephyr_zloc(NULL, purple_conversation_get_connection(conv),args[0]);
- return PURPLE_CMD_RET_OK;
-static PurpleCmdRet zephyr_purple_cmd_instance(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* Currently it sets the instance with leading spaces and
- * all. This might not be the best thing to do, though having
- * one word isn't ideal either. */
- const char* instance = args[0];
- zephyr_chat_set_topic(purple_conversation_get_connection(conv),
- purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)),instance);
- return PURPLE_CMD_RET_OK;
-static PurpleCmdRet zephyr_purple_cmd_joinchat_cir(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* Join a new zephyr chat */
- ZSubscription_t sub = {
- .zsub_classinst = args[1],
- .zsub_recipient = args[2]
- zephyr_join_chat(purple_conversation_get_connection(conv), &sub);
- return PURPLE_CMD_RET_OK;
-static PurpleCmdRet zephyr_purple_cmd_zi(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* args = instance, message */
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if ( zephyr_send_message(zephyr,"message",args[0],"",args[1],zephyr_get_signature(),""))
- return PURPLE_CMD_RET_OK;
- return PURPLE_CMD_RET_FAILED;
-static PurpleCmdRet zephyr_purple_cmd_zci(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* args = class, instance, message */
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if ( zephyr_send_message(zephyr,args[0],args[1],"",args[2],zephyr_get_signature(),""))
- return PURPLE_CMD_RET_OK;
- return PURPLE_CMD_RET_FAILED;
-static PurpleCmdRet zephyr_purple_cmd_zcir(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* args = class, instance, recipient, message */
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if ( zephyr_send_message(zephyr,args[0],args[1],args[2],args[3],zephyr_get_signature(),""))
- return PURPLE_CMD_RET_OK;
- return PURPLE_CMD_RET_FAILED;
-static PurpleCmdRet zephyr_purple_cmd_zir(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* args = instance, recipient, message */
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if ( zephyr_send_message(zephyr,"message",args[0],args[1],args[2],zephyr_get_signature(),""))
- return PURPLE_CMD_RET_OK;
- return PURPLE_CMD_RET_FAILED;
-static PurpleCmdRet zephyr_purple_cmd_zc(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
- /* args = class, message */
- PurpleConnection *gc = purple_conversation_get_connection(conv);
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if ( zephyr_send_message(zephyr,args[0],"PERSONAL","",args[1],zephyr_get_signature(),""))
- return PURPLE_CMD_RET_OK;
- return PURPLE_CMD_RET_FAILED;
-static void zephyr_register_slash_commands(void)
- id = purple_cmd_register("msg","ws", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_msg, _("msg <nick> <message>: Send a private message to a user"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zlocate","w", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_zlocate, _("zlocate <nick>: Locate user"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zl","w", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_zlocate, _("zl <nick>: Locate user"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("instance","s", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_instance, _("instance <instance>: Set the instance to be used on this class"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("inst","s", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_instance, _("inst <instance>: Set the instance to be used on this class"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("topic","s", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_instance, _("topic <instance>: Set the instance to be used on this class"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("sub", "www", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_joinchat_cir,
- _("sub <class> <instance> <recipient>: Join a new chat"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zi","ws", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_zi, _("zi <instance>: Send a message to <message,<i>instance</i>,*>"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zci","wws",PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- _("zci <class> <instance>: Send a message to <<i>class</i>,<i>instance</i>,*>"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zcir","wwws",PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_zcir,
- _("zcir <class> <instance> <recipient>: Send a message to <<i>class</i>,<i>instance</i>,<i>recipient</i>>"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zir","wws",PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- _("zir <instance> <recipient>: Send a message to <MESSAGE,<i>instance</i>,<i>recipient</i>>"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("zc","ws", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- zephyr_purple_cmd_zc, _("zc <class>: Send a message to <<i>class</i>,PERSONAL,*>"), NULL);
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
-static void zephyr_unregister_slash_commands(void)
- g_slist_free_full(cmds, (GDestroyNotify)purple_cmd_unregister);
-/* Resubscribe to the in-memory list of subscriptions and also unsubscriptions */
-zephyr_action_resubscribe(G_GNUC_UNUSED GSimpleAction *action,
- G_GNUC_UNUSED gpointer data)
- const gchar *account_id = NULL;
- PurpleAccountManager *manager = NULL;
- PurpleAccount *account = NULL;
- PurpleConnection *connection = NULL;
- zephyr_account *zephyr = NULL;
- if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
- g_critical("Zephyr resubscribe action parameter is of incorrect type %s",
- g_variant_get_type_string(parameter));
- account_id = g_variant_get_string(parameter, NULL);
- manager = purple_account_manager_get_default();
- account = purple_account_manager_find_by_id(manager, account_id);
- connection = purple_account_get_connection(account);
- zephyr = purple_connection_get_protocol_data(connection);
- for (GSList *s = zephyr->subscrips; s; s = s->next) {
- zephyr_triple *zt = s->data;
- /* XXX We really should care if this fails */
- zephyr->subscribe_to(zephyr, &zt->sub);
- /* XXX handle unsubscriptions */
-zephyr_action_get_subs_from_server(G_GNUC_UNUSED GSimpleAction *action,
- G_GNUC_UNUSED gpointer data)
- const gchar *account_id = NULL;
- PurpleAccountManager *manager = NULL;
- PurpleAccount *account = NULL;
- PurpleConnection *connection = NULL;
- zephyr_account *zephyr = NULL;
- if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
- g_critical("Zephyr get subscriptions action parameter is of incorrect type %s",
- g_variant_get_type_string(parameter));
- account_id = g_variant_get_string(parameter, NULL);
- manager = purple_account_manager_get_default();
- account = purple_account_manager_find_by_id(manager, account_id);
- connection = purple_account_get_connection(account);
- zephyr = purple_connection_get_protocol_data(connection);
- zephyr->get_subs_from_server(zephyr, connection);
-zephyr_protocol_actions_get_prefix(PurpleProtocolActions *actions) {
-zephyr_protocol_actions_get_action_group(PurpleProtocolActions *actions,
- G_GNUC_UNUSED PurpleConnection *connection)
- GSimpleActionGroup *group = NULL;
- GActionEntry entries[] = {
- .activate = zephyr_action_resubscribe,
- .name = "get-subcriptions",
- .activate = zephyr_action_get_subs_from_server,
- gsize nentries = G_N_ELEMENTS(entries);
- group = g_simple_action_group_new();
- g_action_map_add_action_entries(G_ACTION_MAP(group), entries, nentries,
- return G_ACTION_GROUP(group);
-zephyr_protocol_actions_get_menu(PurpleProtocolActions *actions) {
- GMenuItem *item = NULL;
- item = g_menu_item_new(_("Resubscribe"), "prpl-zephyr.resubscribe");
- g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
- g_menu_append_item(menu, item);
- item = g_menu_item_new(_("Retrieve subscriptions from server"),
- "prpl-zephyr.get-subscriptions");
- g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
- g_menu_append_item(menu, item);
-zephyr_protocol_init(ZephyrProtocol *self)
-zephyr_protocol_class_init(ZephyrProtocolClass *klass)
- PurpleProtocolClass *protocol_class = PURPLE_PROTOCOL_CLASS(klass);
- protocol_class->login = zephyr_login;
- protocol_class->close = zephyr_close;
- protocol_class->status_types = zephyr_status_types;
- protocol_class->get_account_options = zephyr_protocol_get_account_options;
-zephyr_protocol_class_finalize(G_GNUC_UNUSED ZephyrProtocolClass *klass)
-zephyr_protocol_actions_iface_init(PurpleProtocolActionsInterface *iface)
- iface->get_prefix = zephyr_protocol_actions_get_prefix;
- iface->get_action_group = zephyr_protocol_actions_get_action_group;
- iface->get_menu = zephyr_protocol_actions_get_menu;
-zephyr_protocol_client_iface_init(PurpleProtocolClientInterface *client_iface)
- client_iface->normalize = zephyr_normalize;
- client_iface->find_blist_chat = zephyr_find_blist_chat;
-zephyr_protocol_server_iface_init(PurpleProtocolServerInterface *server_iface)
- server_iface->get_info = zephyr_zloc;
- server_iface->set_status = zephyr_set_status;
- server_iface->set_info = NULL; /* XXX Location? */
- server_iface->set_buddy_icon = NULL; /* XXX */
-zephyr_protocol_im_iface_init(PurpleProtocolIMInterface *im_iface)
- im_iface->send = zephyr_send_im;
- im_iface->send_typing = zephyr_send_typing;
-zephyr_protocol_chat_iface_init(PurpleProtocolChatInterface *chat_iface)
- chat_iface->info = zephyr_chat_info;
- chat_iface->join = zephyr_protocol_chat_join;
- chat_iface->get_name = zephyr_get_chat_name;
- chat_iface->leave = zephyr_chat_leave;
- chat_iface->send = zephyr_chat_send;
- chat_iface->set_topic = zephyr_protocol_chat_set_topic;
- chat_iface->get_user_real_name = NULL; /* XXX */
-G_DEFINE_DYNAMIC_TYPE_EXTENDED(
- ZephyrProtocol, zephyr_protocol, PURPLE_TYPE_PROTOCOL, 0,
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_ACTIONS,
- zephyr_protocol_actions_iface_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CLIENT,
- zephyr_protocol_client_iface_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_SERVER,
- zephyr_protocol_server_iface_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_IM,
- zephyr_protocol_im_iface_init)
- G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CHAT,
- zephyr_protocol_chat_iface_init));
-zephyr_protocol_new(void) {
- return PURPLE_PROTOCOL(g_object_new(
- "description", _("The chat component of Project Athena."),
- "icon-name", "im-zephyr",
- "icon-resource-path", "/im/pidgin/libpurple/zephyr/icons",
- "options", OPT_PROTO_CHAT_TOPIC | OPT_PROTO_NO_PASSWORD,
-static GPluginPluginInfo *
-zephyr_query(GError **error)
- return purple_plugin_info_new(
- "name", "Zephyr Protocol",
- "version", DISPLAY_VERSION,
- "category", N_("Protocol"),
- "summary", N_("Zephyr Protocol Plugin"),
- "description", N_("Zephyr Protocol Plugin"),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "flags", PURPLE_PLUGIN_INFO_FLAGS_INTERNAL |
- PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD,
-zephyr_load(GPluginPlugin *plugin, GError **error)
- PurpleProtocolManager *manager = purple_protocol_manager_get_default();
- zephyr_protocol_register_type(G_TYPE_MODULE(plugin));
- my_protocol = zephyr_protocol_new();
- if(!purple_protocol_manager_register(manager, my_protocol, error)) {
- g_clear_object(&my_protocol);
- zephyr_register_slash_commands();
-zephyr_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error)
- PurpleProtocolManager *manager = purple_protocol_manager_get_default();
- if(!purple_protocol_manager_unregister(manager, my_protocol, error)) {
- zephyr_unregister_slash_commands();
- g_clear_object(&my_protocol);
-GPLUGIN_NATIVE_PLUGIN_DECLARE(zephyr)
--- a/libpurple/protocols/zephyr/zephyr.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#ifndef PURPLE_ZEPHYR_ZEPHYR_H
-#define PURPLE_ZEPHYR_ZEPHYR_H
-#define ZEPHYR_TYPE_PROTOCOL (zephyr_protocol_get_type())
-G_DECLARE_FINAL_TYPE(ZephyrProtocol, zephyr_protocol, ZEPHYR, PROTOCOL,
-#endif /* PURPLE_ZEPHYR_ZEPHYR_H */
--- a/libpurple/protocols/zephyr/zephyr_account.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#ifndef PURPLE_ZEPHYR_ZEPHYR_ACCOUNT_H
-#define PURPLE_ZEPHYR_ZEPHYR_ACCOUNT_H
-# define HOST_NAME_MAX 255
-typedef struct _zephyr_account zephyr_account;
- PURPLE_ZEPHYR_NONE, /* Non-kerberized ZEPH0.2 */
- PURPLE_ZEPHYR_KRB4, /* ZEPH0.2 w/ KRB4 support */
- PURPLE_ZEPHYR_TZC, /* tzc executable proxy */
- PURPLE_ZEPHYR_INTERGALACTIC_KRB4 /* Kerberized ZEPH0.3 */
-} zephyr_connection_type;
-typedef gboolean (*ZephyrSubscribeToFunc)(zephyr_account *zephyr, ZSubscription_t *sub);
-typedef gboolean (*ZephyrRequestLocationsFunc)(zephyr_account *zephyr, gchar *who);
-typedef gboolean (*ZephyrSendMessageFunc)(zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient,
- const gchar *html_buf, const gchar *sig, const gchar *opcode);
-typedef void (*ZephyrSetLocationFunc)(zephyr_account *zephyr, char *exposure);
-typedef void (*ZephyrGetSubsFromServerFunc)(zephyr_account *zephyr, PurpleConnection *gc);
-typedef void (*ZephyrCloseFunc)(zephyr_account *zephyr);
-struct _zephyr_account {
- PurpleAccount* account;
- char* galaxy; /* not yet useful */
- char* krbtkfile; /* not yet useful */
- GList *pending_zloc_names;
- zephyr_connection_type connection_type;
- GOutputStream *tzc_stdin;
- GInputStream *tzc_stdout;
- ZephyrSubscribeToFunc subscribe_to;
- ZephyrRequestLocationsFunc request_locations;
- ZephyrSendMessageFunc send_message;
- ZephyrSetLocationFunc set_location;
- ZephyrGetSubsFromServerFunc get_subs_from_server;
-gchar *get_zephyr_realm(PurpleAccount *account, const gchar *local_realm);
-void handle_message(PurpleConnection *gc, ZNotice_t *notice);
-void handle_locations(PurpleConnection *gc, const gchar *user, int nlocs, const ZLocations_t *zloc);
-char *zephyr_normalize_local_realm(const zephyr_account *zephyr, const char *orig);
-#endif /* PURPLE_ZEPHYR_ZEPHYR_ACCOUNT_H */
--- a/libpurple/protocols/zephyr/zephyr_err.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
- * This file is automatically generated; please do not edit it.
-#define ZERR_PKTLEN (-772103680L)
-#define ZERR_HEADERLEN (-772103679L)
-#define ZERR_ILLVAL (-772103678L)
-#define ZERR_HMPORT (-772103677L)
-#define ZERR_PORTINUSE (-772103676L)
-#define ZERR_BADPKT (-772103675L)
-#define ZERR_VERS (-772103674L)
-#define ZERR_NOPORT (-772103673L)
-#define ZERR_NONOTICE (-772103672L)
-#define ZERR_QLEN (-772103671L)
-#define ZERR_HMDEAD (-772103670L)
-#define ZERR_INTERNAL (-772103669L)
-#define ZERR_NOLOCATIONS (-772103668L)
-#define ZERR_NOMORELOCS (-772103667L)
-#define ZERR_FIELDLEN (-772103666L)
-#define ZERR_BADFIELD (-772103665L)
-#define ZERR_SERVNAK (-772103664L)
-#define ZERR_AUTHFAIL (-772103663L)
-#define ZERR_LOGINFAIL (-772103662L)
-#define ZERR_NOSUBSCRIPTIONS (-772103661L)
-#define ZERR_NOMORESUBSCRIPTIONS (-772103660L)
-#define ZERR_TOOMANYSUBS (-772103659L)
-#define ZERR_EOF (-772103658L)
-#define ERROR_TABLE_BASE_zeph (-772103680L)
--- a/libpurple/protocols/zephyr/zephyr_html.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,406 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#include "zephyr_html.h"
-typedef struct _zframe zframe;
- /* true for everything but @color, since inside the parens of that one is
- /* </i>, </font>, </b>, etc. */
- /* text including the opening html thingie. */
- /* }=1, ]=2, )=4, >=8 */
-zframe_new_with_text(const gchar *text, const gchar *closing, gboolean has_closer)
- zframe *frame = g_new(zframe, 1);
- frame->text = g_string_new(text);
- frame->closing = closing;
- frame->has_closer = has_closer;
-zframe_new(const gchar *closing, gboolean has_closer)
- return zframe_new_with_text("", closing, has_closer);
-zframe_href_has_prefix(const zframe *frame, const gchar *prefix)
- gsize prefix_len = strlen(prefix);
- return (frame->href->len == (prefix_len + frame->text->len)) &&
- !strncmp(frame->href->str, prefix, prefix_len) &&
- purple_strequal(frame->href->str + prefix_len, frame->text->str);
-html_to_zephyr_pop(GQueue *frames)
- zframe *popped = (zframe *)g_queue_pop_head(frames);
- zframe *head = (zframe *)g_queue_peek_head(frames);
- gsize result = strlen(popped->closing);
- head->href = popped->text;
- g_string_append(head->text, popped->env);
- if (popped->has_closer) {
- g_string_append_c(head->text,
- (popped->closer_mask & 1) ? '{' :
- (popped->closer_mask & 2) ? '[' :
- (popped->closer_mask & 4) ? '(' :
- g_string_append(head->text, popped->text->str);
- if (!purple_strequal(popped->href->str, popped->text->str) &&
- !zframe_href_has_prefix(popped, "http://") &&
- !zframe_href_has_prefix(popped, "mailto:")) {
- g_string_append(head->text, " <");
- g_string_append(head->text, popped->href->str);
- if (popped->closer_mask & ~8) {
- g_string_append_c(head->text, '>');
- popped->closer_mask &= ~8;
- g_string_append(head->text, "@{>}");
- g_string_free(popped->href, TRUE);
- if (popped->has_closer) {
- g_string_append_c(head->text,
- (popped->closer_mask & 1) ? '}' :
- (popped->closer_mask & 2) ? ']' :
- (popped->closer_mask & 4) ? ')' :
- if (!popped->has_closer) {
- head->closer_mask = popped->closer_mask;
- g_string_free(popped->text, TRUE);
-html_to_zephyr(const char *message)
- GQueue frames = G_QUEUE_INIT;
- frame = zframe_new(NULL, FALSE);
- frame->is_href = FALSE;
- frame->closer_mask = 15;
- g_queue_push_head(&frames, frame);
- purple_debug_info("zephyr", "html received %s\n", message);
- frame = (zframe *)g_queue_peek_head(&frames);
- if (frame->closing && purple_str_has_caseprefix(message, frame->closing)) {
- message += html_to_zephyr_pop(&frames);
- } else if (*message == '<') {
- if (!g_ascii_strncasecmp(message + 1, "i>", 2)) {
- new_f = zframe_new("</i>", TRUE);
- new_f->is_href = FALSE;
- new_f->closer_mask = 15;
- g_queue_push_head(&frames, new_f);
- } else if (!g_ascii_strncasecmp(message + 1, "b>", 2)) {
- new_f = zframe_new("</b>", TRUE);
- new_f->is_href = FALSE;
- new_f->closer_mask = 15;
- g_queue_push_head(&frames, new_f);
- } else if (!g_ascii_strncasecmp(message + 1, "br>", 3)) {
- g_string_append_c(frame->text, '\n');
- } else if (!g_ascii_strncasecmp(message + 1, "a href=\"", 8)) {
- new_f = zframe_new("</a>", FALSE);
- new_f->is_href = FALSE;
- new_f->closer_mask = frame->closer_mask;
- g_queue_push_head(&frames, new_f);
- new_f = zframe_new("\">", FALSE);
- new_f->closer_mask = frame->closer_mask;
- g_queue_push_head(&frames, new_f);
- } else if (!g_ascii_strncasecmp(message + 1, "font", 4)) {
- new_f = zframe_new("</font>", TRUE);
- new_f->is_href = FALSE;
- new_f->closer_mask = 15;
- g_queue_push_head(&frames, new_f);
- while (*message == ' ') {
- if (!g_ascii_strncasecmp(message, "color=\"", 7)) {
- new_f = zframe_new("\">", TRUE);
- new_f->is_href = FALSE;
- new_f->closer_mask = 15;
- g_queue_push_head(&frames, new_f);
- } else if (!g_ascii_strncasecmp(message, "face=\"", 6)) {
- new_f = zframe_new("\">", TRUE);
- new_f->is_href = FALSE;
- new_f->closer_mask = 15;
- g_queue_push_head(&frames, new_f);
- } else if (!g_ascii_strncasecmp(message, "size=\"", 6)) {
- if ((*message == '1') || (*message == '2')) {
- } else if ((*message == '3') || (*message == '4')) {
- new_f->env = "@medium";
- } else if ((*message == '5') || (*message == '6')
- || (*message == '7')) {
- new_f->has_closer = FALSE;
- new_f->closer_mask = frame->closer_mask;
- /* Drop all unrecognized/misparsed font tags */
- new_f->has_closer = FALSE;
- new_f->closer_mask = frame->closer_mask;
- while (g_ascii_strncasecmp(message, "\">", 2) != 0) {
- if (*message != '\0') {
- /* Catch all for all unrecognized/misparsed <foo> tags */
- g_string_append_c(frame->text, *message++);
- } else if (*message == '@') {
- g_string_append(frame->text, "@@");
- } else if (*message == '}') {
- if (frame->closer_mask & ~1) {
- frame->closer_mask &= ~1;
- g_string_append_c(frame->text, *message++);
- g_string_append(frame->text, "@[}]");
- } else if (*message == ']') {
- if (frame->closer_mask & ~2) {
- frame->closer_mask &= ~2;
- g_string_append_c(frame->text, *message++);
- g_string_append(frame->text, "@{]}");
- } else if (*message == ')') {
- if (frame->closer_mask & ~4) {
- frame->closer_mask &= ~4;
- g_string_append_c(frame->text, *message++);
- g_string_append(frame->text, "@{)}");
- } else if (!g_ascii_strncasecmp(message, ">", 4)) {
- if (frame->closer_mask & ~8) {
- frame->closer_mask &= ~8;
- g_string_append_c(frame->text, *message++);
- g_string_append(frame->text, "@{>}");
- g_string_append_c(frame->text, *message++);
- frame = (zframe *)g_queue_pop_head(&frames);
- ret = g_string_free(frame->text, FALSE);
- purple_debug_info("zephyr", "zephyr outputted %s\n", ret);
-zephyr_to_html_pop(GQueue *frames, gboolean *last_had_closer)
- zframe *popped = (zframe *)g_queue_pop_head(frames);
- zframe *head = (zframe *)g_queue_peek_head(frames);
- g_string_append(head->text, popped->text->str);
- g_string_append(head->text, popped->closing);
- if (last_had_closer != NULL) {
- *last_had_closer = popped->has_closer;
- g_string_free(popped->text, TRUE);
-zephyr_to_html(const char *message)
- GQueue frames = G_QUEUE_INIT;
- frame = zframe_new("", FALSE);
- g_queue_push_head(&frames, frame);
- frame = (zframe *)g_queue_peek_head(&frames);
- if (*message == '@' && message[1] == '@') {
- g_string_append(frame->text, "@");
- } else if (*message == '@') {
- while (message[end] && (isalnum(message[end]) || message[end] == '_')) {
- (message[end] == '{' || message[end] == '[' || message[end] == '(' ||
- !g_ascii_strncasecmp(message + end, "<", 4))) {
- buf = g_new0(char, end);
- g_snprintf(buf, end, "%s", message + 1);
- closer = (*message == '{' ? "}" :
- *message == '[' ? "]" :
- *message == '(' ? ")" :
- message += (*message == '&' ? 4 : 1);
- if (!g_ascii_strcasecmp(buf, "italic") || !g_ascii_strcasecmp(buf, "i")) {
- new_f = zframe_new_with_text("<i>", "</i>", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "small")) {
- new_f = zframe_new_with_text("<font size=\"1\">", "</font>", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "medium")) {
- new_f = zframe_new_with_text("<font size=\"3\">", "</font>", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "large")) {
- new_f = zframe_new_with_text("<font size=\"7\">", "</font>", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "bold")
- || !g_ascii_strcasecmp(buf, "b")) {
- new_f = zframe_new_with_text("<b>", "</b>", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "font")) {
- extra_f = zframe_new("</font>", FALSE);
- extra_f->closer = frame->closer;
- g_queue_push_head(&frames, extra_f);
- new_f = zframe_new_with_text("<font face=\"", "\">", TRUE);
- } else if (!g_ascii_strcasecmp(buf, "color")) {
- extra_f = zframe_new("</font>", FALSE);
- extra_f->closer = frame->closer;
- g_queue_push_head(&frames, extra_f);
- new_f = zframe_new_with_text("<font color=\"", "\">", TRUE);
- new_f = zframe_new("", TRUE);
- new_f->closer = closer;
- g_queue_push_head(&frames, new_f);
- /* Not a formatting tag, add the character as normal. */
- g_string_append_c(frame->text, *message++);
- } else if (frame->closer && purple_str_has_caseprefix(message, frame->closer)) {
- message += strlen(frame->closer);
- if (g_queue_get_length(&frames) > 1) {
- gboolean last_had_closer;
- zephyr_to_html_pop(&frames, &last_had_closer);
- } while (g_queue_get_length(&frames) > 1 && !last_had_closer);
- g_string_append_c(frame->text, *message);
- } else if (*message == '\n') {
- g_string_append(frame->text, "<br>");
- g_string_append_c(frame->text, *message++);
- /* go through all the stuff that they didn't close */
- while (g_queue_get_length(&frames) > 1) {
- zephyr_to_html_pop(&frames, NULL);
- frame = (zframe *)g_queue_pop_head(&frames);
- ret = g_string_free(frame->text, FALSE);
--- a/libpurple/protocols/zephyr/zephyr_html.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#ifndef PURPLE_ZEPHYR_ZEPHYR_HTML_H
-#define PURPLE_ZEPHYR_ZEPHYR_HTML_H
-/* This parses HTML formatting (put out by one of the gtkimhtml widgets
- And converts it to zephyr formatting.
- It currently deals properly with <b>, <br>, <i>, <font face=...>, <font color=...>,
- It ignores <font back=...>
- <font size = "1 or 2" -> @small
- <a href is dealt with by outputting "description <link>" or just "description" as appropriate
-char *html_to_zephyr(const char *message);
-/* This parses zephyr formatting and converts it to html. For example, if
- * you pass in "@{@color(blue)@i(hello)}" you should get out
- * "<font color=blue><i>hello</i></font>". */
-char *zephyr_to_html(const char *message);
-#endif /* PURPLE_ZEPHYR_ZEPHYR_HTML_H */
--- a/libpurple/protocols/zephyr/zephyr_internal.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,370 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains global definitions
- * Created by: Robert French
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of
- * Technology. For copying and distribution information, see the
- * file "mit-copyright.h".
-#ifndef PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H
-#define PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H
-#ifndef IPPROTO_MAX /* Make sure not already included */
-/* this really should be uint32_t */
-/*typedef unsigned int in_addr_t;
-#define HM_SVCNAME "zephyr-hm"
-#define HM_SRV_SVCNAME "zephyr-hm-srv"
-#define SERVER_SVCNAME "zephyr-clt"
-#define SERVER_SERVICE "zephyr"
-#define SERVER_INSTANCE "zephyr"
-#define ZVERSIONHDR "ZEPH"
-#define Z_MAXPKTLEN 1024
-#define Z_MAXHEADERLEN 800
-#define Z_MAXOTHERFIELDS 10 /* Max unknown fields in ZNotice_t */
-/* Authentication levels returned by ZCheckAuthentication */
-#define ZAUTH_FAILED (-1)
-#define SERVER_SVC_FALLBACK (2103)
-#define HM_SVC_FALLBACK (2104)
-#define HM_SRV_SVC_FALLBACK (2105)
-#define ZAUTH_UNSET (-3) /* Internal to client library. */
-#define Z_MAXFRAGS 500 /* Max number of packet fragments */
-#define Z_MAXNOTICESIZE 400000 /* Max size of incoming notice */
-#define Z_MAXQUEUESIZE 1500000 /* Max size of input queue notices */
-#define Z_FRAGFUDGE 13 /* Room to for multinotice field */
-#define Z_NOTICETIMELIMIT 30 /* Time to wait for fragments */
-#define Z_INITFILTERSIZE 30 /* Starting size of uid filter */
-typedef char ZPacket_t[Z_MAXPKTLEN];
- UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT
-typedef unsigned long ZChecksum_t;
-#define z_sender_addr z_uid.zuid_addr
- const char *z_class_inst;
- const char *z_recipient;
- char *z_default_format;
- ZUnique_Id_t z_multiuid;
- ZChecksum_t z_checksum;
- int z_num_other_fields;
- char *z_other_fields[Z_MAXOTHERFIELDS];
-/* Subscription structure */
-/* Function return code */
-/* Locations structure */
- GSList *holelist; /* element-type: Z_Hole* */
-int ZCompareUIDPred(ZNotice_t *, void *);
-int ZCompareMultiUIDPred(ZNotice_t *, void *);
-/* Defines for ZFormatNotice, et al. */
-typedef Code_t (*Z_AuthProc)(ZNotice_t *, char *, int, int *);
-Code_t ZMakeAuthentication(ZNotice_t *, char *, int, int *);
-const gchar *ZGetVariable(const gchar *);
-Code_t ZSetVariable(char *var, char *value);
-Code_t ZUnsetVariable(char *var);
-Code_t ZSetDestAddr(GSocketAddress *);
-Code_t ZFormatNoticeList(ZNotice_t *, char **, int, char **, int *, Z_AuthProc);
-Code_t ZParseNotice(char *, int, ZNotice_t *);
-Code_t ZReadAscii(char *, int, unsigned char *, int);
-Code_t ZReadAscii32(char *, int, unsigned long *);
-Code_t ZReadAscii16(char *, int, unsigned short *);
-Code_t ZSendPacket(char *, int, int);
-Code_t ZSendList(ZNotice_t *, char *[], int, Z_AuthProc);
-Code_t ZSrvSendList(ZNotice_t *, char *[], int, Z_AuthProc, Code_t (*)());
-Code_t ZSendNotice(ZNotice_t *, Z_AuthProc);
-Code_t ZSrvSendNotice(ZNotice_t *, Z_AuthProc, Code_t (*)());
-Code_t ZFormatNotice(ZNotice_t *, char **, int *, Z_AuthProc);
-Code_t ZFormatSmallNotice(ZNotice_t *, ZPacket_t, int *, Z_AuthProc);
-Code_t ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems,
- char **buffer, int *ret_len);
-Code_t ZLocateUser(char *, int *, Z_AuthProc);
-Code_t ZRequestLocations(const char *, ZAsyncLocateData_t *, ZNotice_Kind_t,
-Code_t ZhmStat(ZNotice_t *);
-Code_t ZInitialize(void);
-Code_t ZFormatSmallRawNotice(ZNotice_t *, ZPacket_t, int *);
-int ZCompareUID(ZUnique_Id_t *, ZUnique_Id_t *);
-Code_t ZMakeAscii(char *, int, unsigned char *, int);
-Code_t ZMakeAscii32(char *, int, unsigned long);
-Code_t ZMakeAscii16(char *, int, unsigned int);
-Code_t ZReceivePacket(ZPacket_t, int *, GSocketAddress **);
-Code_t ZCheckAuthentication(ZNotice_t *);
-Code_t ZSetLocation(char *exposure);
-Code_t ZUnsetLocation(void);
-Code_t ZFlushMyLocations(void);
-Code_t ZFormatRawNotice(ZNotice_t *, char **, int *);
-Code_t ZRetrieveSubscriptions(unsigned short, int *);
-Code_t ZGetSubscriptions(ZSubscription_t *, int *);
-Code_t ZOpenPort(unsigned short *port);
-Code_t ZClosePort(void);
-Code_t ZFlushLocations(void);
-Code_t ZFlushSubscriptions(void);
-Code_t ZFreeNotice(ZNotice_t *notice);
-Code_t ZGetLocations(ZLocations_t *, int *);
-Code_t ZParseLocations(register ZNotice_t *notice,
- register ZAsyncLocateData_t *zald, int *nlocs,
-int ZCompareALDPred(ZNotice_t *notice, void *zald);
-void ZFreeALD(register ZAsyncLocateData_t *zald);
-Code_t ZCheckIfNotice(ZNotice_t *notice, GSocketAddress **from,
- register int (*predicate)(ZNotice_t *, void *),
-Code_t ZPeekPacket(char **buffer, int *ret_len, GSocketAddress **from);
-Code_t ZPeekNotice(ZNotice_t *notice, GSocketAddress **from);
-Code_t ZIfNotice(ZNotice_t *notice, GSocketAddress **from,
- int (*predicate)(ZNotice_t *, void *), void *args);
-Code_t ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
-Code_t ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems,
-Code_t ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
-Code_t ZCancelSubscriptions(unsigned int port);
-Code_t ZReceiveNotice(ZNotice_t *notice, GSocketAddress **from);
-typedef Code_t (*Z_SendProc)(ZNotice_t *, char *, int, int);
-Z_InputQ *Z_GetFirstComplete(void);
-Z_InputQ *Z_GetNextComplete(Z_InputQ *);
-Code_t Z_XmitFragment(ZNotice_t *, char *, int, int);
-void Z_RemQueue(Z_InputQ *);
-Code_t Z_AddNoticeToEntry(Z_InputQ *, ZNotice_t *, int);
-Code_t Z_FormatAuthHeader(ZNotice_t *, char *, int, int *, Z_AuthProc);
-Code_t Z_FormatHeader(ZNotice_t *, char *, int, int *, Z_AuthProc);
-Code_t Z_FormatRawHeader(ZNotice_t *, char *, gsize, int *, char **, char **);
-Code_t Z_ReadEnqueue(void);
-Code_t Z_ReadWait(void);
-Code_t Z_SendLocation(char *, char *, Z_AuthProc, char *);
-Code_t Z_SendFragmentedNotice(ZNotice_t *notice, int len, Z_AuthProc cert_func,
-Code_t Z_WaitForComplete(void);
-Code_t Z_WaitForNotice(ZNotice_t *notice, int (*pred)(ZNotice_t *, void *),
- void *arg, int timeout);
-extern GQueue Z_input_queue;
-extern ZLocations_t *__locate_list;
-extern int __locate_num;
-extern int __locate_next;
-extern ZSubscription_t *__subscriptions_list;
-extern int __subscriptions_num;
-extern int __subscriptions_next;
-extern gint __Zephyr_port; /* Port number */
-extern guint32 __My_addr;
-/* Macros to retrieve Zephyr library values. */
-extern GSocket *__Zephyr_socket;
-extern int __Q_CompleteLength;
-extern GSocketAddress *__HM_addr;
-extern char __Zephyr_realm[];
-#define ZGetSocket() __Zephyr_socket
-#define ZQLength() __Q_CompleteLength
-#define ZGetDestAddr() __HM_addr
-#define ZGetRealm() __Zephyr_realm
-/* Maximum queue length */
-/* Successful function return */
-/* Hostmanager wait time (in secs) */
-/* Server wait time (in secs) */
-#define ZAUTH (ZMakeAuthentication)
-#define ZNOAUTH ((Z_AuthProc)0)
-#define ZSRVACK_SENT "SENT" /* SERVACK codes */
-#define ZSRVACK_NOTSENT "LOST"
-#define ZSRVACK_FAIL "FAIL"
-/* Server internal class */
-#define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */
-/* Control codes sent to a server */
-#define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */
-#define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */
-#define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */
-#define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */
-#define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */
-#define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */
-#define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */
-#define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default
-#define ZEPHYR_CTL_HM "HM" /* Inst: From HM */
-#define HM_BOOT "BOOT" /* Opcode: Boot msg */
-#define HM_FLUSH "FLUSH" /* Opcode: Flush me */
-#define HM_DETACH "DETACH" /* Opcode: Detach me */
-#define HM_ATTACH "ATTACH" /* Opcode: Attach me */
-/* Control codes send to a HostManager */
-#define HM_CTL_CLASS "HM_CTL" /* Class */
-#define HM_CTL_SERVER "SERVER" /* Inst: From server */
-#define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */
-#define SERVER_PING "PING" /* Opcode: PING */
-#define HM_CTL_CLIENT "CLIENT" /* Inst: From client */
-#define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */
-#define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */
-#define HM_STAT_CLASS "HM_STAT" /* Class */
-#define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */
-#define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */
-/* Login class messages */
-#define LOGIN_CLASS "LOGIN" /* Class */
-/* Class Instance is principal of user who is logging in or logging out */
-#define EXPOSE_NONE "NONE" /* Opcode: Not visible */
-#define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */
-#define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */
-#define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */
-#define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */
-#define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */
-#define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login
-#define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */
-#define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */
-/* Locate class messages */
-#define LOCATE_CLASS "USER_LOCATE" /* Class */
-#define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */
-#define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */
-/* Class Instance is principal of user to locate */
-#define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */
-/* WG_CTL class messages */
-#define WG_CTL_CLASS "WG_CTL" /* Class */
-#define WG_CTL_USER "USER" /* Inst: User request */
-#define USER_REREAD "REREAD" /* Opcode: Reread desc file */
-#define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */
-#define USER_STARTUP "STARTUP" /* Opcode: Come out of it */
-#define USER_EXIT "EXIT" /* Opcode: Exit the client */
-#endif /* PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H */
--- a/libpurple/protocols/zephyr/zephyr_tzc.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,619 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#include <glib/gi18n-lib.h>
-typedef gssize (*PollableInputStreamReadFunc)(GPollableInputStream *stream, void *bufcur, GError **error);
-static gboolean tzc_write(zephyr_account *zephyr, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
-tzc_read(zephyr_account *zephyr, PollableInputStreamReadFunc read_func)
- GPollableInputStream *stream = G_POLLABLE_INPUT_STREAM(zephyr->tzc_stdout);
- gchar *buf = g_new(gchar, bufsize);
- gboolean selected = FALSE;
- if (read_func(stream, bufcur, &error) < 0) {
- if (error->code == G_IO_ERROR_WOULD_BLOCK ||
- error->code == G_IO_ERROR_TIMED_OUT) {
- purple_debug_error("zephyr", "couldn't read: %s", error->message);
- purple_connection_error(purple_account_get_connection(zephyr->account), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "couldn't read");
- if ((bufcur - buf) > (bufsize - 1)) {
- if ((buf = g_realloc(buf, bufsize * 2)) == NULL) {
- purple_debug_error("zephyr","Ran out of memory\n");
- bufcur = buf + bufsize;
-tzc_write(zephyr_account *zephyr, const gchar *format, ...)
- va_start(args, format);
- message = g_strdup_vprintf(format, args);
- success = g_output_stream_write_all(zephyr->tzc_stdin, message, strlen(message),
- purple_debug_error("zephyr", "Unable to write a message: %s", error->message);
-/* Munge the outgoing zephyr so that any quotes or backslashes are
- escaped and do not confuse tzc: */
-tzc_escape_msg(const char *message)
- if (!message || !*message) {
- msglen = strlen(message);
- newmsg = g_new0(char, msglen*2 + 1);
- for (gsize pos = 0, pos2 = 0; pos < msglen; pos++, pos2++) {
- if (message[pos] == '\\' || message[pos] == '"') {
- newmsg[pos2] = message[pos];
-tzc_deescape_str(const char *message)
- if (!message || !*message) {
- msglen = strlen(message);
- newmsg = g_new0(char, msglen + 1);
- for (gsize pos = 0, pos2 = 0; pos < msglen; pos++, pos2++) {
- if (message[pos] == '\\') {
- newmsg[pos2] = message[pos];
-get_tzc_process(const zephyr_account *zephyr)
- GSubprocess *tzc_process = NULL;
- gchar **tzc_cmd_array = NULL;
- gboolean found_ps = FALSE;
- /* tzc_command should really be of the form
- ssh username@hostname pathtotzc -e %s
- -- this should not require a password, and ideally should be
- fsh username@hostname pathtotzc -e %s
- tzc_cmd = purple_account_get_string(zephyr->account, "tzc_command", "/usr/bin/tzc -e %s");
- if (!g_shell_parse_argv(tzc_cmd, NULL, &tzc_cmd_array, &error)) {
- purple_debug_error("zephyr", "Unable to parse tzc_command: %s", error->message);
- purple_connection_error(
- purple_account_get_connection(zephyr->account),
- PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
- "invalid tzc_command setting");
- for (i = 0; tzc_cmd_array[i] != NULL; i++) {
- if (purple_strequal(tzc_cmd_array[i], "%s")) {
- g_free(tzc_cmd_array[i]);
- tzc_cmd_array[i] = g_strdup(zephyr->exposure);
- purple_debug_error("zephyr", "tzc exited early");
- purple_connection_error(
- purple_account_get_connection(zephyr->account),
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- "invalid output by tzc (or bad parsing code)");
- g_strfreev(tzc_cmd_array);
- tzc_process = g_subprocess_newv(
- (const gchar *const *)tzc_cmd_array,
- G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_PIPE,
- if (tzc_process == NULL) {
- purple_debug_error("zephyr", "tzc exited early: %s", error->message);
- purple_connection_error(
- purple_account_get_connection(zephyr->account),
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- "invalid output by tzc (or bad parsing code)");
- g_strfreev(tzc_cmd_array);
-pollable_input_stream_read(GPollableInputStream *stream, void *bufcur, GError **error)
- return g_pollable_input_stream_read_nonblocking(stream, bufcur, 1, NULL, error);
-pollable_input_stream_read_with_timeout(GPollableInputStream *stream,
- void *bufcur, GError **error)
- const gint64 timeout = 10 * G_USEC_PER_SEC;
- gint64 now = g_get_monotonic_time();
- while (g_get_monotonic_time() < now + timeout) {
- GError *local_error = NULL;
- gssize ret = g_pollable_input_stream_read_nonblocking(
- stream, bufcur, 1, NULL, &local_error);
- if (local_error->code != G_IO_ERROR_WOULD_BLOCK) {
- g_propagate_error(error, local_error);
- /* Keep on waiting if this is a blocking error. */
- g_clear_error(&local_error);
- g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT,
- "tzc did not respond in time");
-get_paren_level(gint paren_level, gchar ch)
- case '(': return paren_level + 1;
- case ')': return paren_level - 1;
- default: return paren_level;
-parse_tzc_login_data(zephyr_account *zephyr, const gchar *buf, gint buflen)
- gchar *str = g_strndup(buf, buflen);
- purple_debug_info("zephyr", "tempstr parsed");
- /* str should now be a string containing all characters from
- * buf after the first ( to the one before the last paren ).
- * We should have the following possible lisp strings but we don't care
- * (tzcspew . start) (version . "something") (pid . number)
- * We care about 'zephyrid . "username@REALM.NAME"' and
- * 'exposure . "SOMETHING"' */
- if (!g_ascii_strncasecmp(str, "zephyrid", 8)) {
- purple_debug_info("zephyr", "zephyrid found");
- strv = g_strsplit(str + 8, "\"", -1);
- username = strv[1] ? strv[1] : "";
- zephyr->username = g_strdup(username);
- at = strchr(username, '@');
- zephyr->realm = g_strdup(at + 1);
- zephyr->realm = get_zephyr_realm(zephyr->account, "local-realm");
- purple_debug_info("zephyr", "something that's not zephyr id found %s", str);
- /* We don't care about anything else yet */
-tree_child_contents(GNode *tree, int index)
- GNode *child = g_node_nth_child(tree, index);
- return child ? child->data : "";
-find_node(GNode *ptree, gchar *key)
- num_children = g_node_n_children(ptree);
- tc = tree_child_contents(ptree, 0);
- /* g_strcasecmp() is deprecated. What is the encoding here??? */
- if (num_children > 0 && tc && !g_ascii_strcasecmp(tc, key)) {
- for (i = 0; i < num_children; i++) {
- result = find_node(g_node_nth_child(ptree, i), key);
-parse_buffer(const gchar *source, gboolean do_parse)
- GNode *ptree = g_node_new(NULL);
- while(p < strlen(source)) {
- if(g_ascii_isspace(source[p]) || source[p] == '\001') {
- while(source[p] != '\n' && p < strlen(source)) {
- gboolean in_quote = FALSE;
- gboolean escape_next = FALSE;
- while(!(source[end] == ')' && nesting == 0 && !in_quote) && end < strlen(source)) {
- if(source[end] == '\\') {
- nesting = get_paren_level(nesting, source[end]);
- if(source[end] == '"') {
- while(source[end] != end_char && end < strlen(source)) {
- if(source[end] == '\\')
- newstr = g_new0(gchar, end+1-p);
- strncpy(newstr,source+p,end-p);
- if (g_node_n_children(ptree) < MAXCHILDREN) {
- /* In case we surpass maxchildren, ignore this */
- g_node_append(ptree, parse_buffer(newstr, do_parse));
- purple_debug_error("zephyr","too many children in tzc output. skipping\n");
- /* XXX does this have to be strdup'd */
- ptree->data = g_strdup(source);
-tzc_login(zephyr_account *zephyr)
- const gchar *bufend = NULL;
- zephyr->tzc_proc = get_tzc_process(zephyr);
- if (zephyr->tzc_proc == NULL) {
- zephyr->tzc_stdin = g_subprocess_get_stdin_pipe(zephyr->tzc_proc);
- zephyr->tzc_stdout = g_subprocess_get_stdout_pipe(zephyr->tzc_proc);
- purple_debug_info("zephyr", "about to read from tzc");
- buf = tzc_read(zephyr, pollable_input_stream_read_with_timeout);
- bufend = buf + strlen(buf);
- /* ignore all tzcoutput till we've received the first ( */
- while (ptr < bufend && (*ptr != '(')) {
- purple_connection_error(
- purple_account_get_connection(zephyr->account),
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- "invalid output by tzc (or bad parsing code)");
- parenlevel = get_paren_level(parenlevel, *ptr);
- purple_debug_info("zephyr", "tzc parenlevel is %d", parenlevel);
- /* Search for next beginning (, or for the ending */
- } while ((ptr < bufend) && (*ptr != '(') && (*ptr != ')'));
- purple_debug_error("zephyr", "tzc parsing error");
- (foo . bar ) or (foo . "bar") or (foo . chars) or (foo . numbers) or (foo . () )
- Parse all the data between the first and last f, and move past )
- parenlevel = get_paren_level(parenlevel, *ptr);
- } while (parenlevel > 1);
- parse_tzc_login_data(zephyr, tmp + 1, ptr - tmp);
- purple_debug_info("zephyr", "parenlevel is not 1 or 2");
- /* This shouldn't be happening */
- } while (ptr < bufend && parenlevel != 0);
- purple_debug_info("zephyr", "tzc startup done");
-tzc_check_notify(gpointer data)
- PurpleConnection *gc = (PurpleConnection *)data;
- zephyr_account* zephyr = purple_connection_get_protocol_data(gc);
- GNode *newparsetree = NULL;
- gchar *buf = tzc_read(zephyr, pollable_input_stream_read);
- newparsetree = parse_buffer(buf, TRUE);
- if (newparsetree != NULL) {
- if ( (spewtype = tree_child_contents(find_node(newparsetree, "tzcspew"), 2)) ) {
- if (!g_ascii_strncasecmp(spewtype,"message",7)) {
- GNode *msgnode = g_node_nth_child(find_node(newparsetree, "message"), 2);
- /*char *zsig = g_strdup(" ");*/ /* purple doesn't care about zsigs */
- char *msg = tzc_deescape_str(tree_child_contents(msgnode, 1));
- char *buf = g_strdup_printf(" %c%s", '\0', msg);
- memset((char *)¬ice, 0, sizeof(notice));
- notice.z_opcode = tree_child_contents(find_node(newparsetree, "opcode"), 2);
- notice.z_class = tzc_deescape_str(tree_child_contents(find_node(newparsetree, "class"), 2));
- notice.z_class_inst = tree_child_contents(find_node(newparsetree, "instance"), 2);
- notice.z_recipient = zephyr_normalize_local_realm(zephyr, tree_child_contents(find_node(newparsetree, "recipient"), 2));
- notice.z_sender = zephyr_normalize_local_realm(zephyr, tree_child_contents(find_node(newparsetree, "sender"), 2));
- notice.z_default_format = "Class $class, Instance $instance:\n" "To: @bold($recipient) at $time $date\n" "From: @bold($1) <$sender>\n\n$2";
- notice.z_message_len = 1 + 1 + strlen(msg) + 1;
- notice.z_message = buf;
- handle_message(gc, ¬ice);
- else if (!g_ascii_strncasecmp(spewtype,"zlocation",9)) {
- /* check_loc or zephyr_zloc respectively */
- GNode *locations = g_node_nth_child(g_node_nth_child(find_node(newparsetree, "locations"), 2), 0);
- .host = tree_child_contents(g_node_nth_child(locations, 0), 2),
- .time = tree_child_contents(g_node_nth_child(locations, 2), 2),
- handle_locations(gc, tree_child_contents(find_node(newparsetree, "user"), 2),
- (zloc.host && *zloc.host && !purple_strequal(zloc.host, " ")) ? 1 : 0,
- else if (!g_ascii_strncasecmp(spewtype,"subscribed",10)) {
- else if (!g_ascii_strncasecmp(spewtype,"start",5)) {
- else if (!g_ascii_strncasecmp(spewtype,"error",5)) {
- g_node_destroy(newparsetree);
-tzc_subscribe_to(zephyr_account *zephyr, ZSubscription_t *sub)
- /* ((tzcfodder . subscribe) ("class" "instance" "recipient")) */
- return tzc_write(zephyr, "((tzcfodder . subscribe) (\"%s\" \"%s\" \"%s\"))\n",
- sub->zsub_class, sub->zsub_classinst, sub->zsub_recipient);
-tzc_request_locations(zephyr_account *zephyr, gchar *who)
- return tzc_write(zephyr, "((tzcfodder . zlocate) \"%s\")\n", who);
-tzc_send_message(zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient,
- const gchar *html_buf, const gchar *sig, G_GNUC_UNUSED const gchar *opcode)
- /* CMU cclub tzc doesn't grok opcodes for now */
- char *tzc_sig = tzc_escape_msg(sig);
- char *tzc_body = tzc_escape_msg(html_buf);
- result = tzc_write(zephyr, "((tzcfodder . send) (class . \"%s\") (auth . t) (recipients (\"%s\" . \"%s\")) (message . (\"%s\" \"%s\")) ) \n",
- zclass, instance, recipient, tzc_sig, tzc_body);
-tzc_set_location(zephyr_account *zephyr, char *exposure)
- tzc_write(zephyr, "((tzcfodder . set-location) (hostname . \"%s\") (exposure . \"%s\"))\n",
- zephyr->ourhost, exposure);
-tzc_get_subs_from_server(G_GNUC_UNUSED zephyr_account *zephyr, PurpleConnection *gc)
- purple_notify_error(gc, "", "tzc doesn't support this action",
- NULL, purple_request_cpar_from_connection(gc));
-tzc_close(zephyr_account *zephyr)
- g_subprocess_send_signal(zephyr->tzc_proc, SIGTERM);
- if (!g_subprocess_wait(zephyr->tzc_proc, NULL, &error)) {
- purple_debug_error("zephyr",
- "error while attempting to close tzc: %s",
- g_subprocess_force_exit(zephyr->tzc_proc);
- zephyr->tzc_stdin = NULL;
- zephyr->tzc_stdout = NULL;
- g_clear_object(&zephyr->tzc_proc);
--- a/libpurple/protocols/zephyr/zephyr_tzc.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#ifndef PURPLE_ZEPHYR_ZEPHYR_TZC_H
-#define PURPLE_ZEPHYR_ZEPHYR_TZC_H
-#include "zephyr_account.h"
-gboolean tzc_login(zephyr_account *zephyr);
-gint tzc_check_notify(gpointer data);
-gboolean tzc_subscribe_to(zephyr_account *zephyr, ZSubscription_t *sub);
-gboolean tzc_request_locations(zephyr_account *zephyr, gchar *who);
-gboolean tzc_send_message(zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient,
- const gchar *html_buf, const gchar *sig, const gchar *opcode);
-void tzc_set_location(zephyr_account *zephyr, char *exposure);
-void tzc_get_subs_from_server(zephyr_account *zephyr, PurpleConnection *gc);
-void tzc_close(zephyr_account *zephyr);
-#endif /* PURPLE_ZEPHYR_ZEPHYR_TZC_H */
--- a/libpurple/protocols/zephyr/zephyr_zeph02.c Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#include <glib/gi18n-lib.h>
-#include "zephyr_zeph02.h"
-zeph02_login(zephyr_account *zephyr)
- PurpleConnection *pc = purple_account_get_connection(zephyr->account);
- /* XXX Should actually try to report the com_err determined error */
- if (ZInitialize() != ZERR_NONE) {
- purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- "Couldn't initialize zephyr");
- if (ZOpenPort(&(zephyr->port)) != ZERR_NONE) {
- purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- if (ZSetLocation(zephyr->exposure) != ZERR_NONE) {
- purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- "Couldn't set location");
- zephyr->username = g_strdup(ZGetSender());
- zephyr->realm = get_zephyr_realm(zephyr->account, ZGetRealm());
-/* Called when the server notifies us a message couldn't get sent */
-message_failed(PurpleConnection *gc, ZNotice_t *notice)
- if (g_ascii_strcasecmp(notice->z_class, "message")) {
- notify_msg = g_strdup_printf(_("Unable to send to chat %s,%s,%s"),
- notice->z_class, notice->z_class_inst, notice->z_recipient);
- title = notice->z_recipient;
- notify_msg = g_strdup(_("User is offline"));
- purple_notify_error(gc, title, notify_msg, NULL, purple_request_cpar_from_connection(gc));
-/* just for debugging */
-handle_unknown(ZNotice_t *notice)
- purple_debug_error("zephyr", "z_packet: %s\n", notice->z_packet);
- purple_debug_error("zephyr", "z_version: %s\n", notice->z_version);
- purple_debug_error("zephyr", "z_kind: %d\n", (int)(notice->z_kind));
- purple_debug_error("zephyr", "z_class: %s\n", notice->z_class);
- purple_debug_error("zephyr", "z_class_inst: %s\n", notice->z_class_inst);
- purple_debug_error("zephyr", "z_opcode: %s\n", notice->z_opcode);
- purple_debug_error("zephyr", "z_sender: %s\n", notice->z_sender);
- purple_debug_error("zephyr", "z_recipient: %s\n", notice->z_recipient);
- purple_debug_error("zephyr", "z_message: %s\n", notice->z_message);
- purple_debug_error("zephyr", "z_message_len: %d\n", notice->z_message_len);
-zeph02_check_notify(gpointer data)
- /* XXX add real error reporting */
- PurpleConnection *gc = (PurpleConnection*) data;
- /* XXX add real error reporting */
- if (ZReceiveNotice(¬ice, NULL) != ZERR_NONE) {
- switch (notice.z_kind) {
- handle_message(gc, ¬ice);
- if (!(g_ascii_strcasecmp(notice.z_message, ZSRVACK_NOTSENT))) {
- message_failed(gc, ¬ice);
- purple_debug_error("zephyr", "Client ack received\n");
- handle_unknown(¬ice); /* XXX: is it really unknown? */
- /* we'll just ignore things for now */
- handle_unknown(¬ice);
- purple_debug_error("zephyr", "Unhandled notice.\n");
- /* XXX add real error reporting */
-zeph02_subscribe_to(G_GNUC_UNUSED zephyr_account *zephyr, ZSubscription_t *sub)
- return ZSubscribeTo(sub, 1, 0) == ZERR_NONE;
-zeph02_request_locations(G_GNUC_UNUSED zephyr_account *zephyr, gchar *who)
- ZAsyncLocateData_t ald;
- zerr = ZRequestLocations(who, &ald, UNACKED, ZAUTH);
- return zerr == ZERR_NONE;
-zeph02_send_message(G_GNUC_UNUSED zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient,
- const gchar *html_buf, const gchar *sig, const gchar *opcode)
- char *buf = g_strdup_printf("%s%c%s", sig, '\0', html_buf);
- gboolean result = TRUE;
- memset((char *)¬ice, 0, sizeof(notice));
- notice.z_class = zclass;
- notice.z_class_inst = instance;
- notice.z_recipient = recipient;
- notice.z_default_format = "Class $class, Instance $instance:\n" "To: @bold($recipient) at $time $date\n" "From: @bold($1) <$sender>\n\n$2";
- notice.z_message_len = strlen(sig) + 1 + strlen(html_buf) + 1;
- notice.z_message = buf;
- notice.z_opcode = g_strdup(opcode);
- purple_debug_info("zephyr","About to send notice\n");
- if (ZSendNotice(¬ice, ZAUTH) != ZERR_NONE) {
- /* XXX handle errors here */
- purple_debug_info("zephyr", "notice sent\n");
-zeph02_set_location(G_GNUC_UNUSED zephyr_account *zephyr, char *exposure)
- ZSetLocation(exposure);
-zeph02_get_subs_from_server(zephyr_account *zephyr, PurpleConnection *gc)
- if (zephyr->port == 0) {
- purple_debug_error("zephyr", "error while retrieving port\n");
- if ((retval = ZRetrieveSubscriptions(zephyr->port, &nsubs)) != ZERR_NONE) {
- /* XXX better error handling */
- purple_debug_error("zephyr", "error while retrieving subscriptions from server\n");
- subout = g_string_new("Subscription list<br>");
- for (int i = 0; i < nsubs; i++) {
- if ((retval = ZGetSubscriptions(&subs, &one)) != ZERR_NONE) {
- g_string_append_printf(subout, "Class %s Instance %s Recipient %s<br>",
- subs.zsub_class, subs.zsub_classinst, subs.zsub_recipient);
- if (retval == ZERR_NONE) {
- gchar *title = g_strdup_printf("Server subscriptions for %s", zephyr->username);
- purple_notify_formatted(gc, title, title, NULL, subout->str, NULL, NULL);
- /* XXX better error handling */
- purple_debug_error("zephyr", "error while retrieving individual subscription\n");
- g_string_free(subout, TRUE);
-zeph02_close(G_GNUC_UNUSED zephyr_account *zephyr)
- if (ZCancelSubscriptions(0) != ZERR_NONE) {
- if (ZUnsetLocation() != ZERR_NONE) {
- if (ZClosePort() != ZERR_NONE) {
--- a/libpurple/protocols/zephyr/zephyr_zeph02.h Wed Oct 26 01:22:53 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <https://www.gnu.org/licenses/>.
-#ifndef PURPLE_ZEPHYR_ZEPHYR_ZEPH02_H
-#define PURPLE_ZEPHYR_ZEPHYR_ZEPH02_H
-#include "zephyr_account.h"
-gboolean zeph02_login(zephyr_account *zephyr);
-gint zeph02_check_notify(gpointer data);
-gboolean zeph02_subscribe_to(zephyr_account *zephyr, ZSubscription_t *sub);
-gboolean zeph02_request_locations(zephyr_account *zephyr, gchar *who);
-gboolean zeph02_send_message(zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient,
- const gchar *html_buf, const gchar *sig, const gchar *opcode);
-void zeph02_set_location(zephyr_account *zephyr, char *exposure);
-void zeph02_get_subs_from_server(zephyr_account *zephyr, PurpleConnection *gc);
-void zeph02_close(zephyr_account *zephyr);
-#endif /* PURPLE_ZEPHYR_ZEPHYR_ZEPH02_H */
--- a/libpurple/purpleprotocol.h Wed Oct 26 01:22:53 2022 -0500
+++ b/libpurple/purpleprotocol.h Wed Oct 26 01:39:49 2022 -0500
@@ -63,7 +63,7 @@
* @OPT_PROTO_CHAT_TOPIC: Chat rooms have topics.<sbr/>
* IRC and XMPP support this.
* @OPT_PROTO_NO_PASSWORD: Don't require passwords for sign-in.<sbr/>
- * Zephyr doesn't require passwords, so there's no need for a
+ * IRC doesn't require passwords, so there's no need for a * @OPT_PROTO_MAIL_CHECK: Notify on new mail.<sbr/>
* MSN and Yahoo notify you when you have new mail.
--- a/meson.build Wed Oct 26 01:22:53 2022 -0500
+++ b/meson.build Wed Oct 26 01:39:49 2022 -0500
@@ -364,7 +364,7 @@
DEFAULT_PRPLS = ['bonjour', 'demo', 'facebook', 'gg', 'irc', 'ircv3', 'jabber',
- 'novell', 'null', 'sametime', 'zephyr']
+ 'novell', 'null', 'sametime'] ALL_PRPLS = DEFAULT_PRPLS + ['null']
dynamic_list = get_option('dynamic-prpls').split(',')
@@ -381,8 +381,6 @@
elif prpl == 'gg' and not libgadu.found()
- elif prpl == 'zephyr' and IS_WIN32
@@ -398,7 +396,6 @@
DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null')
DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime')
-DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr')
conf.set('HAVE_SYS_UTSNAME_H',
compiler.has_header('sys/utsname.h'))
@@ -525,49 +522,6 @@
sasl = dependency('libsasl2', version : '>= 2.0')
-#######################################################################
-# Check for external libzephyr
-#######################################################################
-ext_zephyr = dependency('zephyr', required : get_option('zephyr'))
-conf.set('LIBZEPHYR_EXT', ext_zephyr.found())
-#######################################################################
-# Check for Kerberos (for Zephyr)
-#######################################################################
-conf.set('ZEPHYR_INT32', 'long')
-kerberos = get_option('krb4')
-# KRB4_CFLAGS='-I${kerberos}/include'
-# if test -d '$kerberos/include/kerberosIV' ; then
-# KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV'
-# KRB4_LDFLAGS='-L${kerberos}/lib'
- elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0
-# KRB4_CFLAGS='-I/usr/local/include/kerberosIV'
- elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0
-# KRB4_CFLAGS='-I/usr/include/kerberosIV'
- conf.set('ZEPHYR_USES_KERBEROS', true)
-# AC_CHECK_LIB(krb4, krb_rd_req,
-# [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'],
-# [AC_CHECK_LIB(krb, krb_rd_req,
-# [KRB4_LIBS='-lkrb -ldes'],
-# [AC_MSG_ERROR([Kerberos 4 libraries not found])],
-# -ldes425 -lkrb5 -lk5crypto -lcom_err)
-# AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
-# AC_CHECK_FUNCS(krb_get_err_text krb_log)
#AC_MSG_CHECKING(for me pot o' gold)
foreach func : ['timegm']
@@ -660,8 +614,6 @@
'Dynamic protocols': DYNAMIC_PRPLS,
'Cyrus SASL support (IRC and XMPP)': sasl,
- 'External libzephyr': ext_zephyr,
- 'Use kerberos 4 with zephyr': kerberos,
}, section: 'Protocol Support', bool_yn: true, list_sep: ', ')
# TODO: Remove `.found()` once https://github.com/mesonbuild/meson/pull/10949
--- a/meson_options.txt Wed Oct 26 01:22:53 2022 -0500
+++ b/meson_options.txt Wed Oct 26 01:39:49 2022 -0500
@@ -37,18 +37,12 @@
option('dynamic-prpls', type : 'string', value: 'all',
description : 'specify which protocols to build dynamically')
-option('krb4', type : 'boolean', value : false,
- description : 'compile Zephyr plugin with Kerberos 4 support')
option('libgadu', type : 'feature',
description : 'compile with libgadu (required for GaduGadu support)')
option('meanwhile', type : 'feature',
description : 'compile with meanwhile')
-option('zephyr', type : 'feature',
- description : 'compile Zephyr plugin against external libzephyr')
##############################################################################
--- a/pidgin/data/im.pidgin.Pidgin3.desktop.in.in Wed Oct 26 01:22:53 2022 -0500
+++ b/pidgin/data/im.pidgin.Pidgin3.desktop.in.in Wed Oct 26 01:39:49 2022 -0500
@@ -4,7 +4,7 @@
X-GNOME-FullName=Pidgin Internet Messenger
Comment=Chat over IM. Supports XMPP, IRC, and more
# TRANSLATORS: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
-Keywords=chat;talk;im;message;bonjour;gadu-gadu;irc;groupwise;jabber;sametime;simple;xmpp;zephyr
+Keywords=chat;talk;im;message;bonjour;gadu-gadu;irc;groupwise;jabber;sametime;simple;xmpp --- a/po/POTFILES.in Wed Oct 26 01:22:53 2022 -0500
+++ b/po/POTFILES.in Wed Oct 26 01:39:49 2022 -0500
@@ -174,53 +174,6 @@
libpurple/protocols/sametime/im_mime.c
libpurple/protocols/sametime/sametime.c
libpurple/protocols/sametime/tests/test_sametime_im_mime.c
-libpurple/protocols/zephyr/ZAsyncLocate.c
-libpurple/protocols/zephyr/ZCkAuth.c
-libpurple/protocols/zephyr/ZCkIfNot.c
-libpurple/protocols/zephyr/ZClosePort.c
-libpurple/protocols/zephyr/ZCmpUID.c
-libpurple/protocols/zephyr/ZCmpUIDP.c
-libpurple/protocols/zephyr/zephyr.c
-libpurple/protocols/zephyr/zephyr_html.c
-libpurple/protocols/zephyr/zephyr_tzc.c
-libpurple/protocols/zephyr/zephyr_zeph02.c
-libpurple/protocols/zephyr/ZFlsLocs.c
-libpurple/protocols/zephyr/ZFlsSubs.c
-libpurple/protocols/zephyr/ZFmtAuth.c
-libpurple/protocols/zephyr/ZFmtList.c
-libpurple/protocols/zephyr/ZFmtNotice.c
-libpurple/protocols/zephyr/ZFmtRaw.c
-libpurple/protocols/zephyr/ZFmtRawLst.c
-libpurple/protocols/zephyr/ZFmtSmRaw.c
-libpurple/protocols/zephyr/ZFreeNot.c
-libpurple/protocols/zephyr/ZGetLocs.c
-libpurple/protocols/zephyr/ZGetSender.c
-libpurple/protocols/zephyr/ZGetSubs.c
-libpurple/protocols/zephyr/ZGetWGPort.c
-libpurple/protocols/zephyr/ZhmStat.c
-libpurple/protocols/zephyr/ZIfNotice.c
-libpurple/protocols/zephyr/ZInit.c
-libpurple/protocols/zephyr/Zinternal.c
-libpurple/protocols/zephyr/ZLocations.c
-libpurple/protocols/zephyr/ZMakeAscii.c
-libpurple/protocols/zephyr/ZMkAuth.c
-libpurple/protocols/zephyr/ZNewLocU.c
-libpurple/protocols/zephyr/ZOpenPort.c
-libpurple/protocols/zephyr/ZParseNot.c
-libpurple/protocols/zephyr/ZPeekNot.c
-libpurple/protocols/zephyr/ZPeekPkt.c
-libpurple/protocols/zephyr/ZPending.c
-libpurple/protocols/zephyr/ZReadAscii.c
-libpurple/protocols/zephyr/ZRecvNot.c
-libpurple/protocols/zephyr/ZRecvPkt.c
-libpurple/protocols/zephyr/ZRetSubs.c
-libpurple/protocols/zephyr/ZSendList.c
-libpurple/protocols/zephyr/ZSendNot.c
-libpurple/protocols/zephyr/ZSendPkt.c
-libpurple/protocols/zephyr/ZSetDest.c
-libpurple/protocols/zephyr/ZSubs.c
-libpurple/protocols/zephyr/ZVariables.c
-libpurple/protocols/zephyr/ZWait4Not.c
libpurple/purpleaccountmanager.c
libpurple/purpleaccountoption.c