Thu, 27 May 2021 20:25:24 -0500
Change the default irc server to libera.chat
This seems to make the most sense for users right now as many many channels have migrated away from freenode with many of them moving to libera.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/675/
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains source for the ZRetrieveSubscriptions and | |
| 3 | * ZRetrieveDefaultSubscriptions functions. | |
| 4 | * | |
| 5 | * Created by: Robert French | |
| 6 | * | |
| 7 | * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology. | |
| 8 | * For copying and distribution information, see the file | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
9 | * "mit-copyright.h". |
| 2086 | 10 | */ |
| 11 | ||
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
7475
diff
changeset
|
12 | #include "internal.h" |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
35993
diff
changeset
|
13 | #include "util.h" |
| 2086 | 14 | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
15 | static Code_t Z_RetSubs(ZNotice_t *notice, int *nsubs, Z_AuthProc auth_routine); |
| 2086 | 16 | |
| 17 | /* Need STDC definition when possible for unsigned short argument. */ | |
| 18 | #ifdef __STDC__ | |
| 19 | Code_t ZRetrieveSubscriptions(unsigned short port, int *nsubs) | |
| 20 | #else | |
| 21 | Code_t ZRetrieveSubscriptions(port,nsubs) | |
| 22 | unsigned short port; | |
| 23 | int *nsubs; | |
| 24 | #endif | |
| 25 | { | |
| 26 | int retval; | |
| 27 | ZNotice_t notice; | |
| 28 | char asciiport[50]; | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
29 | |
| 2086 | 30 | if (!port) /* use default port */ |
| 31 | port = __Zephyr_port; | |
| 32 | ||
| 33 | retval = ZMakeAscii16(asciiport, sizeof(asciiport), ntohs(port)); | |
| 34 | if (retval != ZERR_NONE) | |
| 35 | return (retval); | |
| 36 | ||
| 37 | (void) memset((char *)¬ice, 0, sizeof(notice)); | |
| 38 | notice.z_message = asciiport; | |
| 39 | notice.z_message_len = strlen(asciiport)+1; | |
| 40 | notice.z_opcode = CLIENT_GIMMESUBS; | |
| 41 | ||
| 42 | return(Z_RetSubs(¬ice, nsubs, ZAUTH)); | |
| 43 | } | |
| 44 | ||
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
45 | #if 0 |
| 2086 | 46 | Code_t ZRetrieveDefaultSubscriptions(nsubs) |
| 47 | int *nsubs; | |
| 48 | { | |
| 49 | ZNotice_t notice; | |
| 50 | ||
| 51 | (void) memset((char *)¬ice, 0, sizeof(notice)); | |
| 52 | notice.z_message = (char *) 0; | |
| 53 | notice.z_message_len = 0; | |
| 54 | notice.z_opcode = CLIENT_GIMMEDEFS; | |
| 55 | ||
| 56 | return(Z_RetSubs(¬ice, nsubs, ZNOAUTH)); | |
| 57 | ||
| 58 | } | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
59 | #endif |
| 2086 | 60 | |
| 61 | static Code_t Z_RetSubs(notice, nsubs, auth_routine) | |
| 62 | register ZNotice_t *notice; | |
| 63 | int *nsubs; | |
| 64 | Z_AuthProc auth_routine; | |
| 65 | { | |
| 66 | register int i; | |
| 67 | int retval,nrecv,gimmeack; | |
| 68 | ZNotice_t retnotice; | |
| 69 | char *ptr,*end,*ptr2; | |
| 70 | ||
| 71 | retval = ZFlushSubscriptions(); | |
| 72 | ||
| 73 | if (retval != ZERR_NONE && retval != ZERR_NOSUBSCRIPTIONS) | |
| 74 | return (retval); | |
| 75 | ||
| 76 | if (ZGetFD() < 0) | |
|
7475
987384816492
[gaim-migrate @ 8088]
Mark Doliner <markdoliner@pidgin.im>
parents:
2086
diff
changeset
|
77 | if ((retval = ZOpenPort((unsigned short *)0)) != ZERR_NONE) |
| 2086 | 78 | return (retval); |
| 79 | ||
| 80 | notice->z_kind = ACKED; | |
| 81 | notice->z_port = __Zephyr_port; | |
| 82 | notice->z_class = ZEPHYR_CTL_CLASS; | |
| 83 | notice->z_class_inst = ZEPHYR_CTL_CLIENT; | |
| 84 | notice->z_sender = 0; | |
| 85 | notice->z_recipient = ""; | |
| 86 | notice->z_default_format = ""; | |
| 87 | ||
| 88 | if ((retval = ZSendNotice(notice,auth_routine)) != ZERR_NONE) | |
| 89 | return (retval); | |
| 90 | ||
| 91 | nrecv = 0; | |
| 92 | gimmeack = 0; | |
| 93 | __subscriptions_list = (ZSubscription_t *) 0; | |
| 94 | ||
| 95 | while (!nrecv || !gimmeack) { | |
| 96 | retval = Z_WaitForNotice (&retnotice, ZCompareMultiUIDPred, | |
| 97 | ¬ice->z_multiuid, SRV_TIMEOUT); | |
| 98 | if (retval == ZERR_NONOTICE) | |
| 99 | return ETIMEDOUT; | |
| 100 | else if (retval != ZERR_NONE) | |
| 101 | return retval; | |
| 102 | ||
| 103 | if (retnotice.z_kind == SERVNAK) { | |
| 104 | ZFreeNotice(&retnotice); | |
| 105 | return (ZERR_SERVNAK); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
106 | } |
| 2086 | 107 | /* non-matching protocol version numbers means the |
| 108 | server is probably an older version--must punt */ | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
109 | if (!purple_strequal(notice->z_version,retnotice.z_version)) { |
| 2086 | 110 | ZFreeNotice(&retnotice); |
| 111 | return(ZERR_VERS); | |
| 112 | } | |
| 113 | if (retnotice.z_kind == SERVACK && | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
35993
diff
changeset
|
114 | purple_strequal(retnotice.z_opcode,notice->z_opcode)) { |
| 2086 | 115 | ZFreeNotice(&retnotice); |
| 116 | gimmeack = 1; | |
| 117 | continue; | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
118 | } |
| 2086 | 119 | |
| 120 | if (retnotice.z_kind != ACKED) { | |
| 121 | ZFreeNotice(&retnotice); | |
| 122 | return (ZERR_INTERNAL); | |
| 123 | } | |
| 124 | ||
| 125 | nrecv++; | |
| 126 | ||
| 127 | end = retnotice.z_message+retnotice.z_message_len; | |
| 128 | ||
| 129 | __subscriptions_num = 0; | |
| 130 | for (ptr=retnotice.z_message;ptr<end;ptr++) | |
| 131 | if (!*ptr) | |
| 132 | __subscriptions_num++; | |
| 133 | ||
| 134 | __subscriptions_num = __subscriptions_num / 3; | |
| 135 | ||
|
35993
bd0a2508b477
Fix some other coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31955
diff
changeset
|
136 | free(__subscriptions_list); |
| 2086 | 137 | __subscriptions_list = (ZSubscription_t *) |
| 138 | malloc((unsigned)(__subscriptions_num* | |
| 139 | sizeof(ZSubscription_t))); | |
| 140 | if (__subscriptions_num && !__subscriptions_list) { | |
| 141 | ZFreeNotice(&retnotice); | |
| 142 | return (ENOMEM); | |
| 143 | } | |
| 144 | ||
| 145 | for (ptr=retnotice.z_message,i = 0; i< __subscriptions_num; i++) { | |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
146 | size_t len; |
|
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
147 | |
|
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
148 | len = strlen(ptr) + 1; |
| 2086 | 149 | __subscriptions_list[i].zsub_class = (char *) |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
150 | malloc(len); |
| 2086 | 151 | if (!__subscriptions_list[i].zsub_class) { |
| 152 | ZFreeNotice(&retnotice); | |
| 153 | return (ENOMEM); | |
| 154 | } | |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
155 | g_strlcpy(__subscriptions_list[i].zsub_class,ptr,len); |
|
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
156 | ptr += len; |
|
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
157 | len = strlen(ptr) + 1; |
| 2086 | 158 | __subscriptions_list[i].zsub_classinst = (char *) |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
159 | malloc(len); |
| 2086 | 160 | if (!__subscriptions_list[i].zsub_classinst) { |
| 161 | ZFreeNotice(&retnotice); | |
| 162 | return (ENOMEM); | |
| 163 | } | |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
164 | g_strlcpy(__subscriptions_list[i].zsub_classinst,ptr,len); |
|
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
165 | ptr += len; |
| 2086 | 166 | ptr2 = ptr; |
| 167 | if (!*ptr2) | |
| 168 | ptr2 = "*"; | |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
169 | len = strlen(ptr2) + 1; |
| 2086 | 170 | __subscriptions_list[i].zsub_recipient = (char *) |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
171 | malloc(len); |
| 2086 | 172 | if (!__subscriptions_list[i].zsub_recipient) { |
| 173 | ZFreeNotice(&retnotice); | |
| 174 | return (ENOMEM); | |
| 175 | } | |
|
31955
384153346831
Fix up Zephyr g_strlcpy patch
Ethan Blanton <elb@pidgin.im>
parents:
31954
diff
changeset
|
176 | g_strlcpy(__subscriptions_list[i].zsub_recipient,ptr2,len); |
| 2086 | 177 | ptr += strlen(ptr)+1; |
| 178 | } | |
| 179 | ZFreeNotice(&retnotice); | |
| 180 | } | |
| 181 | ||
| 182 | __subscriptions_next = 0; | |
| 183 | *nsubs = __subscriptions_num; | |
| 184 | ||
| 185 | return (ZERR_NONE); | |
| 186 | } |