void yahoo_chat_goto(PurpleConnection *gc, const char *name) { YahooData *yd; struct yahoo_packet *pkt; yd = gc->proto_data; if (yd->wm) { g_return_if_fail(yd->ycht != NULL); ycht_chat_goto_user(yd->ycht, name); return; } if (!yd->chat_online) { yahoo_chat_online(gc); g_free(yd->pending_chat_room); yd->pending_chat_room = NULL; g_free(yd->pending_chat_id); yd->pending_chat_id = NULL; g_free(yd->pending_chat_topic); yd->pending_chat_topic = NULL; g_free(yd->pending_chat_goto); yd->pending_chat_goto = g_strdup(name); return; } pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, yd->session_id); yahoo_packet_hash(pkt, "sss", 109, name, 1, purple_connection_get_display_name(gc), 62, "2"); yahoo_packet_send_and_free(pkt, yd); }
void yahoo_c_join(PurpleConnection *gc, GHashTable *data) { YahooData *yd; char *room, *topic, *type; PurpleConversation *c; yd = (YahooData *) gc->proto_data; if (!yd) return; room = g_hash_table_lookup(data, "room"); if (!room) return; topic = g_hash_table_lookup(data, "topic"); if (!topic) topic = ""; if ((type = g_hash_table_lookup(data, "type")) && !strcmp(type, "Conference")) { int id; const char *members = g_hash_table_lookup(data, "members"); id = yd->conf_id++; c = serv_got_joined_chat(gc, id, room); yd->confs = g_slist_prepend(yd->confs, c); purple_conv_chat_set_topic(PURPLE_CONV_CHAT(c), purple_connection_get_display_name(gc), topic); yahoo_conf_join(yd, c, purple_connection_get_display_name(gc), room, topic, members); return; } else { const char *id; /*if (yd->in_chat) yahoo_chat_leave(gc, room, purple_connection_get_display_name(gc), FALSE);*/ id = g_hash_table_lookup(data, "id"); if (!yd->chat_online) { yahoo_chat_online(gc); g_free(yd->pending_chat_room); yd->pending_chat_room = g_strdup(room); g_free(yd->pending_chat_id); yd->pending_chat_id = g_strdup(id); g_free(yd->pending_chat_topic); yd->pending_chat_topic = g_strdup(topic); g_free(yd->pending_chat_goto); yd->pending_chat_goto = NULL; } else { yahoo_chat_join(gc, purple_connection_get_display_name(gc), room, topic, id); } return; } }
void yahoo_chat_goto(GaimConnection *gc, const char *name) { struct yahoo_data *yd; struct yahoo_packet *pkt; yd = gc->proto_data; if (!yd->chat_online) yahoo_chat_online(gc); pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, 0); yahoo_packet_hash(pkt, 109, name); yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); yahoo_packet_hash(pkt, 62, "2"); yahoo_send_packet(yd, pkt); yahoo_packet_free(pkt); }
void yahoo_chat_goto(GaimConnection *gc, const char *name) { struct yahoo_data *yd; struct yahoo_packet *pkt; yd = gc->proto_data; if (yd->wm) { g_return_if_fail(yd->ycht != NULL); ycht_chat_goto_user(yd->ycht, name); return; } if (!yd->chat_online) yahoo_chat_online(gc); pkt = yahoo_packet_new(YAHOO_SERVICE_CHATGOTO, YAHOO_STATUS_AVAILABLE, 0); yahoo_packet_hash(pkt, "sss", 109, name, 1, gaim_connection_get_display_name(gc), 62, "2"); yahoo_packet_send_and_free(pkt, yd); }
void yahoo_c_join(GaimConnection *gc, GHashTable *data) { struct yahoo_data *yd; char *room, *topic, *members, *type; int id; GaimConversation *c; yd = (struct yahoo_data *) gc->proto_data; if (!yd) return; room = g_hash_table_lookup(data, "room"); if (!room) return; topic = g_hash_table_lookup(data, "topic"); if (!topic) topic = ""; members = g_hash_table_lookup(data, "members"); if ((type = g_hash_table_lookup(data, "type")) && !strcmp(type, "Conference")) { id = yd->conf_id++; c = serv_got_joined_chat(gc, id, room); yd->confs = g_slist_prepend(yd->confs, c); gaim_conv_chat_set_topic(GAIM_CONV_CHAT(c), gaim_connection_get_display_name(gc), topic); yahoo_conf_join(yd, c, gaim_connection_get_display_name(gc), room, topic, members); return; } else { if (yd->in_chat) yahoo_chat_leave(gc, room, gaim_connection_get_display_name(gc), FALSE); if (!yd->chat_online) yahoo_chat_online(gc); yahoo_chat_join(gc, gaim_connection_get_display_name(gc), room, topic); return; } }