Mercurial > pidgin
annotate src/protocols/zephyr/zephyr.c @ 6890:4eee806af511
[gaim-migrate @ 7436]
Checking for Dll Hell on gaim startup..
committer: Tailor Script <tailor@pidgin.im>
| author | Herman Bloggs <hermanator12002@yahoo.com> |
|---|---|
| date | Thu, 18 Sep 2003 22:12:36 +0000 |
| parents | faa491042c66 |
| children | 7c3a11c69be9 |
| rev | line source |
|---|---|
| 2086 | 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ |
| 2 /* | |
| 3 * gaim | |
| 4 * | |
| 5 * Copyright (C) 1998-2001, Mark Spencer <markster@marko.net> | |
| 6 * Some code borrowed from GtkZephyr, by | |
| 7 * Jag/Sean Dilda <agrajag@linuxpower.org>/<smdilda@unity.ncsu.edu> | |
| 8 * http://gtkzephyr.linuxpower.org/ | |
| 9 * | |
| 10 * This program is free software; you can redistribute it and/or modify | |
| 11 * it under the terms of the GNU General Public License as published by | |
| 12 * the Free Software Foundation; either version 2 of the License, or | |
| 13 * (at your option) any later version. | |
| 14 * | |
| 15 * This program is distributed in the hope that it will be useful, | |
| 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 * GNU General Public License for more details. | |
| 19 * | |
| 20 * You should have received a copy of the GNU General Public License | |
| 21 * along with this program; if not, write to the Free Software | |
| 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 * | |
| 24 */ | |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
25 /* XXX eww */ |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
26 #include "src/internal.h" |
| 2086 | 27 |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
28 #include "debug.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
29 #include "multi.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
30 #include "notify.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
31 #include "prpl.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
32 #include "server.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
33 #include "util.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
34 |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
35 #include "zephyr/zephyr.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
36 |
| 2086 | 37 #include "gaim.h" |
| 38 | |
| 39 extern Code_t ZGetLocations(ZLocations_t *, int *); | |
| 40 extern Code_t ZSetLocation(char *); | |
| 41 extern Code_t ZUnsetLocation(); | |
| 42 | |
| 43 typedef struct _zframe zframe; | |
| 44 typedef struct _zephyr_triple zephyr_triple; | |
| 45 | |
| 46 /* struct I need for zephyr_to_html */ | |
| 47 struct _zframe { | |
| 48 /* true for everything but @color, since inside the parens of that one is | |
| 49 * the color. */ | |
| 50 gboolean has_closer; | |
| 51 /* </i>, </font>, </b>, etc. */ | |
| 52 char *closing; | |
| 53 /* text including the opening html thingie. */ | |
| 54 GString *text; | |
| 55 struct _zframe *enclosing; | |
| 56 }; | |
| 57 | |
| 58 struct _zephyr_triple { | |
| 59 char *class; | |
| 60 char *instance; | |
| 61 char *recipient; | |
| 62 char *name; | |
| 63 gboolean open; | |
| 64 int id; | |
| 65 }; | |
| 66 | |
| 67 #define z_call(func) if (func != ZERR_NONE)\ | |
| 68 return; | |
| 69 #define z_call_r(func) if (func != ZERR_NONE)\ | |
| 70 return TRUE; | |
| 71 #define z_call_s(func, err) if (func != ZERR_NONE) {\ | |
| 5606 | 72 gaim_connection_error(zgc, err);\ |
| 2086 | 73 return;\ |
| 74 } | |
| 75 | |
| 76 static char *zephyr_normalize(const char *); | |
| 77 | |
| 78 /* this is so bad, and if Zephyr weren't so fucked up to begin with I | |
| 79 * wouldn't do this. but it is so i will. */ | |
| 80 static guint32 nottimer = 0; | |
| 81 static guint32 loctimer = 0; | |
| 5606 | 82 GaimConnection *zgc = NULL; |
| 2086 | 83 static GList *pending_zloc_names = NULL; |
| 84 static GSList *subscrips = NULL; | |
| 85 static int last_id = 0; | |
| 86 | |
| 87 /* just for debugging | |
| 88 static void handle_unknown(ZNotice_t notice) | |
| 89 { | |
|
6484
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
90 gaim_debug(GAIM_DEBUG_MISC, "z_packet: %s\n", notice.z_packet); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
91 gaim_debug(GAIM_DEBUG_MISC, "z_version: %s\n", notice.z_version); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
92 gaim_debug(GAIM_DEBUG_MISC, "z_kind: %d\n", notice.z_kind); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
93 gaim_debug(GAIM_DEBUG_MISC, "z_class: %s\n", notice.z_class); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
94 gaim_debug(GAIM_DEBUG_MISC, "z_class_inst: %s\n", notice.z_class_inst); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
95 gaim_debug(GAIM_DEBUG_MISC, "z_opcode: %s\n", notice.z_opcode); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
96 gaim_debug(GAIM_DEBUG_MISC, "z_sender: %s\n", notice.z_sender); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
97 gaim_debug(GAIM_DEBUG_MISC, "z_recipient: %s\n", notice.z_recipient); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
98 gaim_debug(GAIM_DEBUG_MISC, "z_message: %s\n", notice.z_message); |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
99 gaim_debug(GAIM_DEBUG_MISC, "z_message_len: %d\n", notice.z_message_len); |
| 2086 | 100 } |
| 101 */ | |
| 102 | |
| 103 static zephyr_triple *new_triple(const char *c, const char *i, const char *r) | |
| 104 { | |
| 105 zephyr_triple *zt; | |
| 106 zt = g_new0(zephyr_triple, 1); | |
| 107 zt->class = g_strdup(c); | |
| 108 zt->instance = g_strdup(i); | |
| 109 zt->recipient = g_strdup(r); | |
| 110 zt->name = g_strdup_printf("%s,%s,%s", c, i, r); | |
| 111 zt->id = ++last_id; | |
| 112 zt->open = FALSE; | |
| 113 return zt; | |
| 114 } | |
| 115 | |
| 116 static void free_triple(zephyr_triple *zt) | |
| 117 { | |
| 118 g_free(zt->class); | |
| 119 g_free(zt->instance); | |
| 120 g_free(zt->recipient); | |
| 121 g_free(zt->name); | |
| 122 g_free(zt); | |
| 123 } | |
| 124 | |
| 125 /* returns true if zt1 is a subset of zt2, i.e. zt2 has the same thing or | |
| 126 * wildcards in each field of zt1. */ | |
| 127 static gboolean triple_subset(zephyr_triple *zt1, zephyr_triple *zt2) | |
| 128 { | |
| 4793 | 129 if (g_ascii_strcasecmp(zt2->class, zt1->class) && |
| 130 g_ascii_strcasecmp(zt2->class, "*")) { | |
| 2086 | 131 return FALSE; |
| 132 } | |
| 4793 | 133 if (g_ascii_strcasecmp(zt2->instance, zt1->instance) && |
| 134 g_ascii_strcasecmp(zt2->instance, "*")) { | |
| 2086 | 135 return FALSE; |
| 136 } | |
| 4793 | 137 if (g_ascii_strcasecmp(zt2->recipient, zt1->recipient) && |
| 138 g_ascii_strcasecmp(zt2->recipient, "*")) { | |
| 2086 | 139 return FALSE; |
| 140 } | |
| 141 return TRUE; | |
| 142 } | |
| 143 | |
| 144 static zephyr_triple *find_sub_by_triple(zephyr_triple *zt) | |
| 145 { | |
| 146 zephyr_triple *curr_t; | |
| 147 GSList *curr = subscrips; | |
| 148 while (curr) { | |
| 149 curr_t = curr->data; | |
| 150 if (triple_subset(zt, curr_t)) | |
| 151 return curr_t; | |
| 152 curr = curr->next; | |
| 153 } | |
| 154 return NULL; | |
| 155 } | |
| 156 | |
| 157 static zephyr_triple *find_sub_by_id(int id) | |
| 158 { | |
| 159 zephyr_triple *zt; | |
| 160 GSList *curr = subscrips; | |
| 161 while (curr) { | |
| 162 zt = curr->data; | |
| 163 if (zt->id == id) | |
| 164 return zt; | |
| 165 curr = curr->next; | |
| 166 } | |
| 167 return NULL; | |
| 168 } | |
| 169 | |
| 170 /* utility macros that are useful for zephyr_to_html */ | |
| 171 | |
| 172 #define IS_OPENER(c) ((c == '{') || (c == '[') || (c == '(') || (c == '<')) | |
| 173 #define IS_CLOSER(c) ((c == '}') || (c == ']') || (c == ')') || (c == '>')) | |
| 174 | |
| 175 /* this parses zephyr formatting and converts it to html. For example, if | |
| 176 * you pass in "@{@color(blue)@i(hello)}" you should get out | |
| 177 * "<font color=blue><i>hello</i></font>". */ | |
| 178 static char *zephyr_to_html(char *message) | |
| 179 { | |
| 180 int len, cnt; | |
| 181 zframe *frames, *curr; | |
| 182 char *ret; | |
| 183 | |
| 184 frames = g_new(zframe, 1); | |
| 185 frames->text = g_string_new(""); | |
| 186 frames->enclosing = NULL; | |
| 187 frames->closing = ""; | |
| 188 frames->has_closer = FALSE; | |
| 189 | |
| 190 len = strlen(message); | |
| 191 cnt = 0; | |
| 192 while (cnt <= len) { | |
| 193 if (message[cnt] == '@') { | |
| 194 zframe *new_f; | |
| 195 char *buf; | |
| 196 int end; | |
| 197 for (end=1; (cnt+end) <= len && | |
| 198 !IS_OPENER(message[cnt+end]); end++); | |
| 199 buf = g_new0(char, end); | |
| 200 if (end) { | |
| 201 g_snprintf(buf, end, "%s", message+cnt+1); | |
| 202 } | |
| 4793 | 203 if (!g_ascii_strcasecmp(buf, "italic") || |
| 204 !g_ascii_strcasecmp(buf, "i")) { | |
| 2086 | 205 new_f = g_new(zframe, 1); |
| 206 new_f->enclosing = frames; | |
| 207 new_f->text = g_string_new("<i>"); | |
| 208 new_f->closing = "</i>"; | |
| 209 new_f->has_closer = TRUE; | |
| 210 frames = new_f; | |
| 211 cnt += end+1; /* cnt points to char after opener */ | |
| 4793 | 212 } else if (!g_ascii_strcasecmp(buf, "bold") |
| 213 || !g_ascii_strcasecmp(buf, "b")) { | |
| 2086 | 214 new_f = g_new(zframe, 1); |
| 215 new_f->enclosing = frames; | |
| 216 new_f->text = g_string_new("<b>"); | |
| 217 new_f->closing = "</b>"; | |
| 218 new_f->has_closer = TRUE; | |
| 219 frames = new_f; | |
| 220 cnt += end+1; | |
| 4793 | 221 } else if (!g_ascii_strcasecmp(buf, "color")) { |
| 2086 | 222 cnt += end+1; |
| 223 new_f = g_new(zframe, 1); | |
| 224 new_f->enclosing = frames; | |
| 225 new_f->text = g_string_new("<font color="); | |
| 226 for (; (cnt <= len) && !IS_CLOSER(message[cnt]); cnt++) { | |
| 227 g_string_append_c(new_f->text, message[cnt]); | |
| 228 } | |
| 229 cnt++; /* point to char after closer */ | |
| 230 g_string_append_c(new_f->text, '>'); | |
| 231 new_f->closing = "</font>"; | |
| 232 new_f->has_closer = FALSE; | |
| 233 frames = new_f; | |
| 4793 | 234 } else if (!g_ascii_strcasecmp(buf, "")) { |
| 2086 | 235 new_f = g_new(zframe, 1); |
| 236 new_f->enclosing = frames; | |
| 237 new_f->text = g_string_new(""); | |
| 238 new_f->closing = ""; | |
| 239 new_f->has_closer = TRUE; | |
| 240 frames = new_f; | |
| 241 cnt += end+1; /* cnt points to char after opener */ | |
| 242 } else { | |
| 243 if ((cnt+end) > len) { | |
| 244 g_string_append_c(frames->text, '@'); | |
| 245 cnt++; | |
| 246 } else { | |
| 247 /* unrecognized thingie. act like it's not there, but we | |
| 248 * still need to take care of the corresponding closer, | |
| 249 * make a frame that does nothing. */ | |
| 250 new_f = g_new(zframe, 1); | |
| 251 new_f->enclosing = frames; | |
| 252 new_f->text = g_string_new(""); | |
| 253 new_f->closing = ""; | |
| 254 new_f->has_closer = TRUE; | |
| 255 frames = new_f; | |
| 256 cnt += end+1; /* cnt points to char after opener */ | |
| 257 } | |
| 258 } | |
| 259 } else if (IS_CLOSER(message[cnt])) { | |
| 260 zframe *popped; | |
| 261 gboolean last_had_closer; | |
| 262 if (frames->enclosing) { | |
| 263 do { | |
| 264 popped = frames; | |
| 265 frames = frames->enclosing; | |
| 266 g_string_append(frames->text, popped->text->str); | |
| 267 g_string_append(frames->text, popped->closing); | |
| 268 g_string_free(popped->text, TRUE); | |
| 269 last_had_closer = popped->has_closer; | |
| 270 g_free(popped); | |
| 271 } while (frames && frames->enclosing && !last_had_closer); | |
| 272 } else { | |
| 273 g_string_append_c(frames->text, message[cnt]); | |
| 274 } | |
| 275 cnt++; | |
| 276 } else if (message[cnt] == '\n') { | |
| 277 g_string_append(frames->text, "<br>"); | |
| 278 cnt++; | |
| 279 } else { | |
| 280 g_string_append_c(frames->text, message[cnt++]); | |
| 281 } | |
| 282 } | |
| 283 /* go through all the stuff that they didn't close */ | |
| 284 while (frames->enclosing) { | |
| 285 curr = frames; | |
| 286 g_string_append(frames->enclosing->text, frames->text->str); | |
| 287 g_string_append(frames->enclosing->text, frames->closing); | |
| 288 g_string_free(frames->text, TRUE); | |
| 289 frames = frames->enclosing; | |
| 290 g_free(curr); | |
| 291 } | |
| 292 ret = frames->text->str; | |
| 293 g_string_free(frames->text, FALSE); | |
| 294 g_free(frames); | |
| 295 return ret; | |
| 296 } | |
| 297 | |
| 298 static gboolean pending_zloc(char *who) | |
| 299 { | |
| 300 GList *curr; | |
| 301 for (curr = pending_zloc_names; curr != NULL; curr = curr->next) { | |
| 4793 | 302 if (!g_ascii_strcasecmp(who, (char*)curr->data)) { |
| 2086 | 303 g_free((char*)curr->data); |
| 304 pending_zloc_names = g_list_remove(pending_zloc_names, curr->data); | |
| 305 return TRUE; | |
| 306 } | |
| 307 } | |
| 308 return FALSE; | |
| 309 } | |
| 310 | |
| 311 static void handle_message(ZNotice_t notice, struct sockaddr_in from) | |
| 312 { | |
| 4793 | 313 if (!g_ascii_strcasecmp(notice.z_class, LOGIN_CLASS)) { |
| 3277 | 314 /* well, we'll be updating in 20 seconds anyway, might as well ignore this. */ |
| 4793 | 315 } else if (!g_ascii_strcasecmp(notice.z_class, LOCATE_CLASS)) { |
| 316 if (!g_ascii_strcasecmp(notice.z_opcode, LOCATE_LOCATE)) { | |
| 2086 | 317 int nlocs; |
| 318 char *user; | |
| 6695 | 319 GaimBuddy *b; |
| 2086 | 320 |
| 321 if (ZParseLocations(¬ice, NULL, &nlocs, &user) != ZERR_NONE) | |
| 322 return; | |
| 4687 | 323 if ((b = gaim_find_buddy(zgc->account, user)) == NULL) { |
| 2086 | 324 char *e = strchr(user, '@'); |
| 325 if (e) *e = '\0'; | |
| 4687 | 326 b = gaim_find_buddy(zgc->account, user); |
| 2086 | 327 } |
| 328 if (!b) { | |
| 329 free(user); | |
| 330 return; | |
| 331 } | |
| 332 if (pending_zloc(b->name)) { | |
| 333 ZLocations_t locs; | |
| 334 int one = 1; | |
| 335 GString *str = g_string_new(""); | |
| 5132 | 336 g_string_append_printf(str, _("<b>User:</b> %s<br>"), b->name); |
| 337 if (b->alias) | |
| 338 g_string_append_printf(str, _("<b>Alias:</b> %s<br>"), b->alias); | |
| 2086 | 339 if (!nlocs) { |
| 5132 | 340 g_string_append_printf(str, _("<br>Hidden or not logged-in")); |
| 2086 | 341 } |
| 342 for (; nlocs > 0; nlocs--) { | |
| 343 ZGetLocations(&locs, &one); | |
| 5132 | 344 g_string_append_printf(str, _("<br>At %s since %s"), locs.host, |
| 2086 | 345 locs.time); |
| 346 } | |
|
2791
8f6365332a05
[gaim-migrate @ 2804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
347 g_show_info_text(NULL, NULL, 2, str->str, NULL); |
| 2086 | 348 g_string_free(str, TRUE); |
| 349 } else | |
| 4732 | 350 serv_got_update(zgc, b->name, nlocs, 0, 0, 0, 0); |
| 2086 | 351 |
| 352 free(user); | |
| 353 } | |
| 354 } else { | |
| 355 char *buf, *buf2; | |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
356 char *send_inst; |
| 3277 | 357 char *realmptr; |
| 358 char *sendertmp; | |
| 2086 | 359 char *ptr = notice.z_message + strlen(notice.z_message) + 1; |
| 360 int len = notice.z_message_len - (ptr - notice.z_message); | |
| 6679 | 361 GaimImFlags flags = 0; |
| 2086 | 362 if (len > 0) { |
| 363 buf = g_malloc(len + 1); | |
| 364 g_snprintf(buf, len + 1, "%s", ptr); | |
| 365 g_strchomp(buf); | |
| 366 buf2 = zephyr_to_html(buf); | |
| 367 g_free(buf); | |
| 4793 | 368 if (!g_ascii_strcasecmp(notice.z_class, "MESSAGE") && |
| 369 !g_ascii_strcasecmp(notice.z_class_inst, "PERSONAL")) { | |
| 370 if (!g_ascii_strcasecmp(notice.z_message, "Automated reply:")) | |
| 6622 | 371 flags |= GAIM_IM_AUTO_RESP; |
| 372 serv_got_im(zgc, notice.z_sender, buf2, flags, time(NULL), -1); | |
| 2086 | 373 } else { |
| 374 zephyr_triple *zt1, *zt2; | |
| 375 zt1 = new_triple(notice.z_class, notice.z_class_inst, | |
| 4687 | 376 notice.z_recipient); |
| 2086 | 377 zt2 = find_sub_by_triple(zt1); |
| 378 if (!zt2) { | |
| 379 /* we shouldn't be subscribed to this message. ignore. */ | |
| 380 } else { | |
| 381 if (!zt2->open) { | |
| 382 zt2->open = TRUE; | |
| 383 serv_got_joined_chat(zgc, zt2->id, zt2->name); | |
| 384 } | |
| 3277 | 385 /* If the person is in the default Realm, then strip the |
| 386 Realm from the sender field */ | |
| 387 sendertmp = g_strdup_printf("%s",notice.z_sender); | |
| 4682 | 388 if ((realmptr = strchr(sendertmp,'@')) != NULL) { |
| 4588 | 389 realmptr++; |
| 4793 | 390 if (!g_ascii_strcasecmp(realmptr,ZGetRealm())) { |
| 4588 | 391 realmptr--; |
| 392 sprintf(realmptr,"%c",'\0'); | |
| 393 send_inst = g_strdup_printf("%s %s",sendertmp, | |
| 394 notice.z_class_inst); | |
| 395 } else { | |
| 396 send_inst = g_strdup_printf("%s %s",notice.z_sender, | |
| 397 notice.z_class_inst); | |
| 398 } | |
| 3277 | 399 } else { |
| 4588 | 400 send_inst = g_strdup_printf("%s %s",sendertmp,notice.z_class_inst); |
| 3277 | 401 } |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
402 serv_got_chat_in(zgc, zt2->id, send_inst, FALSE, |
| 4687 | 403 buf2, time(NULL)); |
| 3277 | 404 g_free(sendertmp); |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
405 g_free(send_inst); |
| 2086 | 406 } |
| 407 free_triple(zt1); | |
| 408 } | |
| 409 g_free(buf2); | |
| 410 } | |
| 411 } | |
| 412 } | |
| 413 | |
| 414 static gint check_notify(gpointer data) | |
| 415 { | |
| 416 while (ZPending()) { | |
| 417 ZNotice_t notice; | |
| 418 struct sockaddr_in from; | |
| 419 z_call_r(ZReceiveNotice(¬ice, &from)); | |
| 420 | |
| 421 switch (notice.z_kind) { | |
| 422 case UNSAFE: | |
| 423 case UNACKED: | |
| 424 case ACKED: | |
| 425 handle_message(notice, from); | |
| 426 break; | |
| 427 default: | |
| 428 /* we'll just ignore things for now */ | |
|
6484
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
429 gaim_debug(GAIM_DEBUG_WARNING, "zephyr", "Unhandled notice.\n"); |
| 2086 | 430 break; |
| 431 } | |
| 432 | |
| 433 ZFreeNotice(¬ice); | |
| 434 } | |
| 435 | |
| 436 return TRUE; | |
| 437 } | |
| 438 | |
| 439 static gint check_loc(gpointer data) | |
| 440 { | |
| 6695 | 441 GaimBlistNode *gnode, *cnode, *bnode; |
| 2086 | 442 ZAsyncLocateData_t ald; |
| 443 | |
| 444 ald.user = NULL; | |
| 445 memset(&(ald.uid), 0, sizeof(ZUnique_Id_t)); | |
| 446 ald.version = NULL; | |
| 447 | |
| 4785 | 448 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
| 449 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
| 450 continue; | |
| 6695 | 451 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
| 452 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
| 4785 | 453 continue; |
| 6695 | 454 for(bnode = gnode->child; bnode; bnode = bnode->next) { |
| 455 GaimBuddy *b = (GaimBuddy *)bnode; | |
| 456 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
| 457 continue; | |
| 458 if(b->account->gc == zgc) { | |
| 459 char *chk; | |
| 460 chk = zephyr_normalize(b->name); | |
| 461 /* doesn't matter if this fails or not; we'll just move on to the next one */ | |
| 462 ZRequestLocations(chk, &ald, UNACKED, ZAUTH); | |
| 463 free(ald.user); | |
| 464 free(ald.version); | |
| 465 } | |
| 4349 | 466 } |
| 2086 | 467 } |
| 468 } | |
| 469 | |
| 470 return TRUE; | |
| 471 } | |
| 472 | |
| 473 static char *get_exposure_level() | |
| 474 { | |
| 475 char *exposure = ZGetVariable("exposure"); | |
| 476 | |
| 477 if (!exposure) | |
| 478 return EXPOSE_REALMVIS; | |
| 4793 | 479 if (!g_ascii_strcasecmp(exposure, EXPOSE_NONE)) |
| 2086 | 480 return EXPOSE_NONE; |
| 4793 | 481 if (!g_ascii_strcasecmp(exposure, EXPOSE_OPSTAFF)) |
| 2086 | 482 return EXPOSE_OPSTAFF; |
| 4793 | 483 if (!g_ascii_strcasecmp(exposure, EXPOSE_REALMANN)) |
| 2086 | 484 return EXPOSE_REALMANN; |
| 4793 | 485 if (!g_ascii_strcasecmp(exposure, EXPOSE_NETVIS)) |
| 2086 | 486 return EXPOSE_NETVIS; |
| 4793 | 487 if (!g_ascii_strcasecmp(exposure, EXPOSE_NETANN)) |
| 2086 | 488 return EXPOSE_NETANN; |
| 489 return EXPOSE_REALMVIS; | |
| 490 } | |
| 491 | |
| 492 static void strip_comments(char *str) | |
| 493 { | |
| 494 char *tmp = strchr(str, '#'); | |
| 495 if (tmp) | |
| 496 *tmp = '\0'; | |
| 497 g_strchug(str); | |
| 498 g_strchomp(str); | |
| 499 } | |
| 500 | |
| 501 static void process_zsubs() | |
| 502 { | |
| 503 FILE *f; | |
| 504 gchar *fname; | |
| 505 gchar buff[BUFSIZ]; | |
| 506 | |
| 3630 | 507 fname = g_strdup_printf("%s/.zephyr.subs", gaim_home_dir()); |
| 2086 | 508 f = fopen(fname, "r"); |
| 509 if (f) { | |
| 510 char **triple; | |
| 511 ZSubscription_t sub; | |
| 512 char *recip; | |
| 513 while (fgets(buff, BUFSIZ, f)) { | |
| 514 strip_comments(buff); | |
| 515 if (buff[0]) { | |
| 516 triple = g_strsplit(buff, ",", 3); | |
| 3277 | 517 if (triple[0] && triple[1] ) { |
| 5132 | 518 /* char *tmp = g_strdup_printf("%s@%s", g_getenv("USER"), ZGetRealm()); */ |
| 4588 | 519 char *tmp = g_strdup_printf("%s",ZGetSender()); |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
520 char *atptr; |
| 2086 | 521 sub.zsub_class = triple[0]; |
| 522 sub.zsub_classinst = triple[1]; | |
| 3277 | 523 if(triple[2] == NULL) { |
| 524 recip = g_malloc0(1); | |
| 4793 | 525 } else if (!g_ascii_strcasecmp(triple[2], "%me%")) { |
| 4588 | 526 recip = g_strdup_printf("%s",ZGetSender()); |
| 4793 | 527 } else if (!g_ascii_strcasecmp(triple[2], "*")) { |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
528 /* wildcard |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
529 * form of class,instance,* */ |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
530 recip = g_malloc0(1); |
| 4793 | 531 } else if (!g_ascii_strcasecmp(triple[2], tmp)) { |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
532 /* form of class,instance,aatharuv@ATHENA.MIT.EDU */ |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
533 recip = g_strdup(triple[2]); |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
534 } else if ((atptr = strchr(triple[2], '@')) != NULL) { |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
535 /* form of class,instance,*@ANDREW.CMU.EDU |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
536 * class,instance,@ANDREW.CMU.EDU |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
537 * If realm is local realm, blank recipient, else |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
538 * @REALM-NAME |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
539 */ |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
540 char *realmat = g_strdup_printf("@%s", ZGetRealm()); |
| 4793 | 541 if (!g_ascii_strcasecmp(atptr, realmat)) |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
542 recip = g_malloc0(1); |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
543 else |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
544 recip = g_strdup(atptr); |
|
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
545 g_free(realmat); |
| 2086 | 546 } else { |
| 547 recip = g_strdup(triple[2]); | |
| 548 } | |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
549 g_free(tmp); |
| 2086 | 550 sub.zsub_recipient = recip; |
| 551 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { | |
|
6484
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
552 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
553 "Couldn't subscribe to %s, %s, %s\n", |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
554 sub.zsub_class, |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
555 sub.zsub_classinst, |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
556 sub.zsub_recipient); |
| 2086 | 557 } |
| 558 subscrips = g_slist_append(subscrips, | |
| 559 new_triple(triple[0], triple[1], recip)); | |
| 560 g_free(recip); | |
| 561 } | |
| 562 g_strfreev(triple); | |
| 563 } | |
| 564 } | |
| 565 } | |
| 566 } | |
| 567 | |
| 568 static void process_anyone() | |
| 569 { | |
| 570 FILE *fd; | |
| 571 gchar buff[BUFSIZ], *filename; | |
| 6695 | 572 GaimGroup *g; |
| 573 GaimBuddy *b; | |
| 4775 | 574 |
| 575 if (!(g = gaim_find_group(_("Anyone")))) { | |
| 576 g = gaim_group_new(_("Anyone")); | |
| 577 gaim_blist_add_group(g, NULL); | |
| 578 } | |
| 6695 | 579 |
| 3630 | 580 filename = g_strconcat(gaim_home_dir(), "/.anyone", NULL); |
| 2086 | 581 if ((fd = fopen(filename, "r")) != NULL) { |
| 582 while (fgets(buff, BUFSIZ, fd)) { | |
| 583 strip_comments(buff); | |
| 4687 | 584 if (buff[0]) { |
| 585 b = gaim_buddy_new(zgc->account, buff, NULL); | |
| 6695 | 586 gaim_blist_add_buddy(b, NULL, g, NULL); |
| 4687 | 587 } |
| 2086 | 588 } |
| 589 fclose(fd); | |
| 590 } | |
| 591 g_free(filename); | |
| 592 } | |
| 593 | |
| 5606 | 594 static void zephyr_login(GaimAccount *account) |
| 2086 | 595 { |
| 596 ZSubscription_t sub; | |
| 597 | |
| 598 if (zgc) { | |
|
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
599 gaim_notify_error(account->gc, NULL, |
|
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
600 _("Already logged in with Zephyr"), |
|
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
601 _("Because Zephyr uses your system username, you " |
|
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
602 "are unable to have multiple accounts on it " |
|
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
603 "when logged in as the same user.")); |
| 2086 | 604 return; |
| 605 } | |
| 606 | |
| 5606 | 607 zgc = gaim_account_get_connection(account); |
| 2086 | 608 |
| 609 z_call_s(ZInitialize(), "Couldn't initialize zephyr"); | |
| 610 z_call_s(ZOpenPort(NULL), "Couldn't open port"); | |
| 611 z_call_s(ZSetLocation(get_exposure_level()), "Couldn't set location"); | |
| 612 | |
| 613 sub.zsub_class = "MESSAGE"; | |
| 614 sub.zsub_classinst = "PERSONAL"; | |
| 615 sub.zsub_recipient = ZGetSender(); | |
| 616 | |
| 617 /* we don't care if this fails. i'm lying right now. */ | |
| 618 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { | |
|
6484
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
619 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", |
|
5ced8e111473
[gaim-migrate @ 6998]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
620 "Couldn't subscribe to messages!\n"); |
| 2086 | 621 } |
| 622 | |
| 5606 | 623 gaim_connection_set_state(zgc, GAIM_CONNECTED); |
| 2086 | 624 serv_finish_login(zgc); |
| 625 | |
| 626 process_anyone(); | |
| 627 process_zsubs(); | |
| 628 | |
|
2131
acc11216ec5d
[gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
629 nottimer = g_timeout_add(100, check_notify, NULL); |
|
2804
1648c703ddc2
[gaim-migrate @ 2817]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2791
diff
changeset
|
630 loctimer = g_timeout_add(20000, check_loc, NULL); |
| 2086 | 631 } |
| 632 | |
| 633 static void write_zsubs() | |
| 634 { | |
| 635 GSList *s = subscrips; | |
| 636 zephyr_triple *zt; | |
| 637 FILE *fd; | |
| 638 char *fname; | |
| 639 | |
| 3277 | 640 char** triple; |
| 3630 | 641 fname = g_strdup_printf("%s/.zephyr.subs", gaim_home_dir()); |
| 2086 | 642 fd = fopen(fname, "w"); |
| 643 | |
| 644 if (!fd) { | |
| 645 g_free(fname); | |
| 646 return; | |
| 647 } | |
| 648 | |
| 649 while (s) { | |
| 650 zt = s->data; | |
| 3277 | 651 triple = g_strsplit(zt->name,",",3); |
| 652 if (triple[2] != NULL) { | |
| 4793 | 653 if (!g_ascii_strcasecmp(triple[2], "")) { |
| 3277 | 654 fprintf(fd, "%s,%s,*\n", triple[0], triple[1]); |
| 4793 | 655 } else if (!g_ascii_strcasecmp(triple[2], ZGetSender())) { |
| 3277 | 656 fprintf(fd, "%s,%s,%%me%%\n",triple[0],triple[1]); |
| 657 } else { | |
| 658 fprintf(fd, "%s\n", zt->name); | |
| 659 } | |
| 660 } else { | |
| 661 fprintf(fd, "%s,%s,*\n",triple[0], triple[1]); | |
| 662 } | |
| 663 g_free(triple); | |
| 2086 | 664 s = s->next; |
| 665 } | |
| 666 g_free(fname); | |
| 667 fclose(fd); | |
| 668 } | |
| 669 | |
| 670 static void write_anyone() | |
| 671 { | |
| 6695 | 672 GaimBlistNode *gnode, *cnode, *bnode; |
| 673 GaimBuddy *b; | |
| 3277 | 674 char *ptr, *fname, *ptr2; |
| 2086 | 675 FILE *fd; |
| 676 | |
| 3630 | 677 fname = g_strdup_printf("%s/.anyone", gaim_home_dir()); |
| 2086 | 678 fd = fopen(fname, "w"); |
| 679 if (!fd) { | |
| 680 g_free(fname); | |
| 681 return; | |
| 682 } | |
| 683 | |
| 4785 | 684 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
| 685 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
| 686 continue; | |
| 6695 | 687 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
| 688 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
| 4785 | 689 continue; |
| 6695 | 690 for(bnode = gnode->child; bnode; bnode = bnode->next) { |
| 691 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
| 692 continue; | |
| 693 b = (GaimBuddy *)bnode; | |
| 694 if(b->account->gc == zgc) { | |
| 695 if ((ptr = strchr(b->name, '@')) != NULL) { | |
| 696 ptr2 = ptr + 1; | |
| 697 /* We should only strip the realm name if the principal | |
| 698 is in the user's realm | |
| 699 */ | |
| 700 if (!g_ascii_strcasecmp(ptr2,ZGetRealm())) { | |
| 701 *ptr = '\0'; | |
| 702 } | |
| 4349 | 703 } |
| 6695 | 704 fprintf(fd, "%s\n", b->name); |
| 705 if (ptr) | |
| 706 *ptr = '@'; | |
| 3277 | 707 } |
| 708 } | |
| 2086 | 709 } |
| 710 } | |
| 711 | |
| 712 fclose(fd); | |
| 713 g_free(fname); | |
| 714 } | |
| 715 | |
| 5606 | 716 static void zephyr_close(GaimConnection *gc) |
| 2086 | 717 { |
| 718 GList *l; | |
| 719 GSList *s; | |
| 720 l = pending_zloc_names; | |
| 721 while (l) { | |
| 722 g_free((char*)l->data); | |
| 723 l = l->next; | |
| 724 } | |
| 725 g_list_free(pending_zloc_names); | |
| 726 | |
| 727 write_anyone(); | |
| 728 write_zsubs(); | |
| 729 | |
| 730 s = subscrips; | |
| 731 while (s) { | |
| 732 free_triple((zephyr_triple*)s->data); | |
| 733 s = s->next; | |
| 734 } | |
| 735 g_slist_free(subscrips); | |
| 736 | |
| 737 if (nottimer) | |
|
2131
acc11216ec5d
[gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
738 g_source_remove(nottimer); |
| 2086 | 739 nottimer = 0; |
| 740 if (loctimer) | |
|
2131
acc11216ec5d
[gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
741 g_source_remove(loctimer); |
| 2086 | 742 loctimer = 0; |
| 743 zgc = NULL; | |
| 744 z_call(ZCancelSubscriptions(0)); | |
| 745 z_call(ZUnsetLocation()); | |
| 746 z_call(ZClosePort()); | |
| 747 } | |
| 748 | |
|
6787
faa491042c66
[gaim-migrate @ 7326]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
749 static void zephyr_add_buddy(GaimConnection *gc, const char *buddy, GaimGroup *group) { } |
| 6059 | 750 static void zephyr_remove_buddy(GaimConnection *gc, const char *buddy, const char *group) { } |
| 2086 | 751 |
| 6059 | 752 static int zephyr_chat_send(GaimConnection *gc, int id, const char *im) |
| 2086 | 753 { |
| 754 ZNotice_t notice; | |
| 755 zephyr_triple *zt; | |
| 756 char *buf; | |
| 757 const char *sig; | |
| 758 | |
| 759 zt = find_sub_by_id(id); | |
| 760 if (!zt) | |
| 761 /* this should never happen. */ | |
|
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2162
diff
changeset
|
762 return -EINVAL; |
| 2086 | 763 |
| 764 sig = ZGetVariable("zwrite-signature"); | |
| 765 if (!sig) { | |
| 766 sig = g_get_real_name(); | |
| 767 } | |
| 768 buf = g_strdup_printf("%s%c%s", sig, '\0', im); | |
| 769 | |
| 770 bzero((char *)¬ice, sizeof(notice)); | |
| 771 notice.z_kind = ACKED; | |
| 772 notice.z_port = 0; | |
| 773 notice.z_opcode = ""; | |
| 774 notice.z_class = zt->class; | |
| 775 notice.z_class_inst = zt->instance; | |
| 4793 | 776 if (!g_ascii_strcasecmp(zt->recipient, "*")) |
| 2086 | 777 notice.z_recipient = zephyr_normalize(""); |
| 778 else | |
| 779 notice.z_recipient = zephyr_normalize(zt->recipient); | |
| 780 notice.z_sender = 0; | |
| 781 notice.z_default_format = | |
| 782 "Class $class, Instance $instance:\n" | |
| 783 "To: @bold($recipient) at $time $date\n" | |
| 784 "From: @bold($1) <$sender>\n\n$2"; | |
| 785 notice.z_message_len = strlen(im) + strlen(sig) + 4; | |
| 786 notice.z_message = buf; | |
| 787 ZSendNotice(¬ice, ZAUTH); | |
| 788 g_free(buf); | |
|
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2162
diff
changeset
|
789 return 0; |
| 2086 | 790 } |
| 791 | |
| 6622 | 792 static int zephyr_send_im(GaimConnection *gc, const char *who, const char *im, int len, GaimImFlags flags) { |
| 2086 | 793 ZNotice_t notice; |
| 794 char *buf; | |
| 795 const char *sig; | |
| 796 | |
| 6622 | 797 if (flags & GAIM_IM_AUTO_RESP) |
| 2086 | 798 sig = "Automated reply:"; |
| 799 else { | |
| 800 sig = ZGetVariable("zwrite-signature"); | |
| 801 if (!sig) { | |
| 802 sig = g_get_real_name(); | |
| 803 } | |
| 804 } | |
| 805 buf = g_strdup_printf("%s%c%s", sig, '\0', im); | |
| 806 | |
| 807 bzero((char *)¬ice, sizeof(notice)); | |
| 808 notice.z_kind = ACKED; | |
| 809 notice.z_port = 0; | |
| 810 notice.z_opcode = ""; | |
| 811 notice.z_class = "MESSAGE"; | |
| 812 notice.z_class_inst = "PERSONAL"; | |
| 813 notice.z_sender = 0; | |
| 814 notice.z_recipient = who; | |
| 815 notice.z_default_format = | |
| 816 "Class $class, Instance $instance:\n" | |
| 817 "To: @bold($recipient) at $time $date\n" | |
| 818 "From: @bold($1) <$sender>\n\n$2"; | |
| 819 notice.z_message_len = strlen(im) + strlen(sig) + 4; | |
| 820 notice.z_message = buf; | |
| 821 g_free(buf); | |
|
2303
f5bf315e6104
[gaim-migrate @ 2313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2231
diff
changeset
|
822 return 1; |
| 2086 | 823 } |
| 824 | |
| 825 static char *zephyr_normalize(const char *orig) | |
| 826 { | |
| 827 static char buf[80]; | |
| 828 if (strchr(orig, '@')) { | |
| 829 g_snprintf(buf, 80, "%s", orig); | |
| 830 } else { | |
| 831 g_snprintf(buf, 80, "%s@%s", orig, ZGetRealm()); | |
| 832 } | |
| 833 return buf; | |
| 834 } | |
| 835 | |
| 5606 | 836 static void zephyr_zloc(GaimConnection *gc, const char *who) |
| 2086 | 837 { |
| 838 ZAsyncLocateData_t ald; | |
| 839 | |
| 840 if (ZRequestLocations(zephyr_normalize(who), &ald, UNACKED, ZAUTH) | |
| 841 != ZERR_NONE) { | |
| 842 return; | |
| 843 } | |
| 844 pending_zloc_names = g_list_append(pending_zloc_names, | |
| 845 g_strdup(zephyr_normalize(who))); | |
| 846 } | |
| 847 | |
| 5606 | 848 static GList *zephyr_buddy_menu(GaimConnection *gc, const char *who) |
| 2086 | 849 { |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
850 GList *m = NULL; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
851 struct proto_buddy_menu *pbm; |
| 2086 | 852 |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
853 pbm = g_new0(struct proto_buddy_menu, 1); |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
854 pbm->label = _("ZLocate"); |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
855 pbm->callback = zephyr_zloc; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
856 pbm->gc = gc; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
857 m = g_list_append(m, pbm); |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
858 |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
859 return m; |
| 2086 | 860 } |
| 861 | |
| 6059 | 862 static void zephyr_set_away(GaimConnection *gc, const char *state, const char *msg) |
| 2086 | 863 { |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3867
diff
changeset
|
864 if (gc->away) { |
| 2086 | 865 g_free(gc->away); |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3867
diff
changeset
|
866 gc->away = NULL; |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3867
diff
changeset
|
867 } |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3867
diff
changeset
|
868 |
| 5132 | 869 if (!g_ascii_strcasecmp(state, _("Hidden"))) { |
| 2086 | 870 ZSetLocation(EXPOSE_OPSTAFF); |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3867
diff
changeset
|
871 gc->away = g_strdup(""); |
| 5132 | 872 } else if (!g_ascii_strcasecmp(state, _("Online"))) |
| 2086 | 873 ZSetLocation(get_exposure_level()); |
| 874 else /* state is GAIM_AWAY_CUSTOM */ if (msg) | |
| 875 gc->away = g_strdup(msg); | |
| 876 } | |
| 877 | |
| 5606 | 878 static GList *zephyr_away_states(GaimConnection *gc) |
| 2086 | 879 { |
| 880 GList *m = NULL; | |
| 881 | |
| 5132 | 882 m = g_list_append(m, _("Online")); |
| 2086 | 883 m = g_list_append(m, GAIM_AWAY_CUSTOM); |
| 5132 | 884 m = g_list_append(m, _("Hidden")); |
| 2086 | 885 |
| 886 return m; | |
| 887 } | |
| 888 | |
| 5606 | 889 static GList *zephyr_chat_info(GaimConnection *gc) { |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
890 GList *m = NULL; |
|
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
891 struct proto_chat_entry *pce; |
| 2086 | 892 |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
893 pce = g_new0(struct proto_chat_entry, 1); |
|
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
894 pce->label = _("Class:"); |
| 5234 | 895 pce->identifier = "class"; |
| 3158 | 896 m = g_list_append(m, pce); |
| 2086 | 897 |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
898 pce = g_new0(struct proto_chat_entry, 1); |
|
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
899 pce->label = _("Instance:"); |
| 5234 | 900 pce->identifier = "instance"; |
| 3158 | 901 m = g_list_append(m, pce); |
| 2086 | 902 |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
903 pce = g_new0(struct proto_chat_entry, 1); |
|
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
904 pce->label = _("Recipient:"); |
| 5234 | 905 pce->identifier = "recipient"; |
| 3158 | 906 m = g_list_append(m, pce); |
| 2086 | 907 |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
908 return m; |
| 2086 | 909 } |
| 910 | |
| 5606 | 911 static void zephyr_join_chat(GaimConnection *gc, GHashTable *data) |
| 2086 | 912 { |
| 913 ZSubscription_t sub; | |
| 914 zephyr_triple *zt1, *zt2; | |
| 915 const char *classname; | |
| 916 const char *instname; | |
| 917 const char *recip; | |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
918 |
| 5234 | 919 classname = g_hash_table_lookup(data, "class"); |
| 920 instname = g_hash_table_lookup(data, "instance"); | |
| 921 recip = g_hash_table_lookup(data, "recipient"); | |
| 922 | |
| 923 if (!classname || !instname || !recip) | |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2170
diff
changeset
|
924 return; |
| 2086 | 925 |
| 4793 | 926 if (!g_ascii_strcasecmp(recip, "%me%")) |
| 4588 | 927 recip = ZGetSender(); |
| 2086 | 928 |
| 929 zt1 = new_triple(classname, instname, recip); | |
| 930 zt2 = find_sub_by_triple(zt1); | |
| 931 if (zt2) { | |
| 932 free_triple(zt1); | |
| 933 if (!zt2->open) | |
| 934 serv_got_joined_chat(gc, zt2->id, zt2->name); | |
| 935 return; | |
| 936 } | |
| 937 | |
| 938 sub.zsub_class = zt1->class; | |
| 939 sub.zsub_classinst = zt1->instance; | |
| 940 sub.zsub_recipient = zt1->recipient; | |
| 941 | |
| 942 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { | |
| 943 free_triple(zt1); | |
| 944 return; | |
| 945 } | |
| 946 | |
| 947 subscrips = g_slist_append(subscrips, zt1); | |
| 948 zt1->open = TRUE; | |
| 949 serv_got_joined_chat(gc, zt1->id, zt1->name); | |
| 950 } | |
| 951 | |
| 5606 | 952 static void zephyr_chat_leave(GaimConnection *gc, int id) |
| 2086 | 953 { |
| 954 zephyr_triple *zt; | |
| 955 zt = find_sub_by_id(id); | |
| 956 if (zt) { | |
| 957 zt->open = FALSE; | |
| 958 zt->id = ++last_id; | |
| 959 } | |
| 960 } | |
| 961 | |
| 6695 | 962 static const char *zephyr_list_icon(GaimAccount *a, GaimBuddy *b) |
| 5202 | 963 { |
| 964 return "zephyr"; | |
| 965 } | |
| 966 | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
967 static GaimPlugin *my_protocol = NULL; |
| 2086 | 968 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
969 static GaimPluginProtocolInfo prpl_info = |
| 2086 | 970 { |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
971 GAIM_PROTO_ZEPHYR, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
972 OPT_PROTO_NO_PASSWORD, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
973 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
974 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
975 zephyr_list_icon, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
976 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
977 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
978 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
979 zephyr_away_states, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
980 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
981 zephyr_buddy_menu, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
982 zephyr_chat_info, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
983 zephyr_login, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
984 zephyr_close, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
985 zephyr_send_im, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
986 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
987 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
988 zephyr_zloc, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
989 zephyr_set_away, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
990 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
991 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
992 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
993 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
994 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
995 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
996 zephyr_add_buddy, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
997 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
998 zephyr_remove_buddy, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
999 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1000 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1001 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1002 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1003 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1004 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1005 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1006 zephyr_join_chat, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1007 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1008 zephyr_chat_leave, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1009 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1010 zephyr_chat_send, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1011 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1012 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1013 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1014 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1015 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1016 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1017 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1018 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1019 NULL, |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1020 zephyr_normalize |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1021 }; |
| 2086 | 1022 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1023 static GaimPluginInfo info = |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1024 { |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1025 2, /**< api_version */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1026 GAIM_PLUGIN_PROTOCOL, /**< type */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1027 NULL, /**< ui_requirement */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1028 0, /**< flags */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1029 NULL, /**< dependencies */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1030 GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1031 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1032 "prpl-zephyr", /**< id */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1033 "Zephyr", /**< name */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1034 VERSION, /**< version */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1035 /** summary */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1036 N_("Zephyr Protocol Plugin"), |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1037 /** description */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1038 N_("Zephyr Protocol Plugin"), |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1039 NULL, /**< author */ |
|
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
1040 GAIM_WEBSITE, /**< homepage */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1041 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1042 NULL, /**< load */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1043 NULL, /**< unload */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1044 NULL, /**< destroy */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1045 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1046 NULL, /**< ui_info */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1047 &prpl_info /**< extra_info */ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1048 }; |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1049 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1050 static void |
|
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1051 init_plugin(GaimPlugin *plugin) |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1052 { |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5202
diff
changeset
|
1053 my_protocol = plugin; |
| 2086 | 1054 } |
| 1055 | |
|
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1056 GAIM_INIT_PLUGIN(zephyr, init_plugin, info); |
