| 85 static int last_id = 0; |
85 static int last_id = 0; |
| 86 |
86 |
| 87 /* just for debugging |
87 /* just for debugging |
| 88 static void handle_unknown(ZNotice_t notice) |
88 static void handle_unknown(ZNotice_t notice) |
| 89 { |
89 { |
| 90 debug_printf("z_packet: %s\n", notice.z_packet); |
90 gaim_debug(GAIM_DEBUG_MISC, "z_packet: %s\n", notice.z_packet); |
| 91 debug_printf("z_version: %s\n", notice.z_version); |
91 gaim_debug(GAIM_DEBUG_MISC, "z_version: %s\n", notice.z_version); |
| 92 debug_printf("z_kind: %d\n", notice.z_kind); |
92 gaim_debug(GAIM_DEBUG_MISC, "z_kind: %d\n", notice.z_kind); |
| 93 debug_printf("z_class: %s\n", notice.z_class); |
93 gaim_debug(GAIM_DEBUG_MISC, "z_class: %s\n", notice.z_class); |
| 94 debug_printf("z_class_inst: %s\n", notice.z_class_inst); |
94 gaim_debug(GAIM_DEBUG_MISC, "z_class_inst: %s\n", notice.z_class_inst); |
| 95 debug_printf("z_opcode: %s\n", notice.z_opcode); |
95 gaim_debug(GAIM_DEBUG_MISC, "z_opcode: %s\n", notice.z_opcode); |
| 96 debug_printf("z_sender: %s\n", notice.z_sender); |
96 gaim_debug(GAIM_DEBUG_MISC, "z_sender: %s\n", notice.z_sender); |
| 97 debug_printf("z_recipient: %s\n", notice.z_recipient); |
97 gaim_debug(GAIM_DEBUG_MISC, "z_recipient: %s\n", notice.z_recipient); |
| 98 debug_printf("z_message: %s\n", notice.z_message); |
98 gaim_debug(GAIM_DEBUG_MISC, "z_message: %s\n", notice.z_message); |
| 99 debug_printf("z_message_len: %d\n", notice.z_message_len); |
99 gaim_debug(GAIM_DEBUG_MISC, "z_message_len: %d\n", notice.z_message_len); |
| 100 debug_printf("\n"); |
|
| 101 } |
100 } |
| 102 */ |
101 */ |
| 103 |
102 |
| 104 static zephyr_triple *new_triple(const char *c, const char *i, const char *r) |
103 static zephyr_triple *new_triple(const char *c, const char *i, const char *r) |
| 105 { |
104 { |
| 546 recip = g_strdup(triple[2]); |
545 recip = g_strdup(triple[2]); |
| 547 } |
546 } |
| 548 g_free(tmp); |
547 g_free(tmp); |
| 549 sub.zsub_recipient = recip; |
548 sub.zsub_recipient = recip; |
| 550 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { |
549 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { |
| 551 debug_printf("Zephyr: Couldn't subscribe to %s, %s, " |
550 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", |
| 552 "%s\n", |
551 "Couldn't subscribe to %s, %s, %s\n", |
| 553 sub.zsub_class, |
552 sub.zsub_class, |
| 554 sub.zsub_classinst, |
553 sub.zsub_classinst, |
| 555 sub.zsub_recipient); |
554 sub.zsub_recipient); |
| 556 } |
555 } |
| 557 subscrips = g_slist_append(subscrips, |
556 subscrips = g_slist_append(subscrips, |
| 558 new_triple(triple[0], triple[1], recip)); |
557 new_triple(triple[0], triple[1], recip)); |
| 559 g_free(recip); |
558 g_free(recip); |
| 560 } |
559 } |
| 613 sub.zsub_classinst = "PERSONAL"; |
612 sub.zsub_classinst = "PERSONAL"; |
| 614 sub.zsub_recipient = ZGetSender(); |
613 sub.zsub_recipient = ZGetSender(); |
| 615 |
614 |
| 616 /* we don't care if this fails. i'm lying right now. */ |
615 /* we don't care if this fails. i'm lying right now. */ |
| 617 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { |
616 if (ZSubscribeTo(&sub, 1, 0) != ZERR_NONE) { |
| 618 debug_printf("Zephyr: Couldn't subscribe to messages!\n"); |
617 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", |
| |
618 "Couldn't subscribe to messages!\n"); |
| 619 } |
619 } |
| 620 |
620 |
| 621 gaim_connection_set_state(zgc, GAIM_CONNECTED); |
621 gaim_connection_set_state(zgc, GAIM_CONNECTED); |
| 622 serv_finish_login(zgc); |
622 serv_finish_login(zgc); |
| 623 |
623 |