Пример #1
0
Файл: chat.c Проект: VoxOx/VoxOx
GaimRoomlist *jabber_roomlist_get_list(GaimConnection *gc)
{
	JabberStream *js = gc->proto_data;
	GList *fields = NULL;
	GaimRoomlistField *f;

	if(js->roomlist)
		gaim_roomlist_unref(js->roomlist);

	js->roomlist = gaim_roomlist_new(gaim_connection_get_account(js->gc));

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "room", TRUE);
	fields = g_list_append(fields, f);

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "server", TRUE);
	fields = g_list_append(fields, f);

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Description"), "description", FALSE);
	fields = g_list_append(fields, f);

	gaim_roomlist_set_fields(js->roomlist, fields);


	gaim_request_input(gc, _("Enter a Conference Server"), _("Enter a Conference Server"),
			_("Select a conference server to query"),
			js->chat_servers ? js->chat_servers->data : "conference.jabber.org",
			FALSE, FALSE, NULL,
			_("Find Rooms"), GAIM_CALLBACK(roomlist_ok_cb),
			_("Cancel"), GAIM_CALLBACK(roomlist_cancel_cb), js);

	return js->roomlist;
}
Пример #2
0
Файл: irc.c Проект: VoxOx/VoxOx
static GaimRoomlist *irc_roomlist_get_list(GaimConnection *gc)
{
	struct irc_conn *irc;
	GList *fields = NULL;
	GaimRoomlistField *f;
	char *buf;

	irc = gc->proto_data;

	if (irc->roomlist)
		gaim_roomlist_unref(irc->roomlist);

	irc->roomlist = gaim_roomlist_new(gaim_connection_get_account(gc));

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "channel", TRUE);
	fields = g_list_append(fields, f);

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_INT, _("Users"), "users", FALSE);
	fields = g_list_append(fields, f);

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Topic"), "topic", FALSE);
	fields = g_list_append(fields, f);

	gaim_roomlist_set_fields(irc->roomlist, fields);

	buf = irc_format(irc, "v", "LIST");
	irc_send(irc, buf);
	g_free(buf);

	return irc->roomlist;
}
Пример #3
0
/*  get a list of qq groups */
GaimRoomlist *qq_roomlist_get_list(GaimConnection *gc)
{
	GList *fields;
	qq_data *qd;
	GaimRoomlist *rl;
	GaimRoomlistField *f;

	qd = (qq_data *) gc->proto_data;

	fields = NULL;
	rl = gaim_roomlist_new(gaim_connection_get_account(gc));
	qd->roomlist = rl;

	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Group ID"), QQ_GROUP_KEY_EXTERNAL_ID, FALSE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Creator"), QQ_GROUP_KEY_CREATOR_UID, FALSE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING,
				    _("Group Description"), QQ_GROUP_KEY_GROUP_DESC_UTF8, FALSE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", QQ_GROUP_KEY_INTERNAL_ID, TRUE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", QQ_GROUP_KEY_GROUP_TYPE, TRUE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Auth"), QQ_GROUP_KEY_AUTH_TYPE, TRUE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", QQ_GROUP_KEY_GROUP_CATEGORY, TRUE);
	fields = g_list_append(fields, f);
	f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", QQ_GROUP_KEY_GROUP_NAME_UTF8, TRUE);

	fields = g_list_append(fields, f);
	gaim_roomlist_set_fields(rl, fields);
	gaim_roomlist_set_in_progress(qd->roomlist, TRUE);

	gaim_request_input(gc, _("QQ Qun"),
			   _("Please input external group ID"),
			   _("You can only search for permanent QQ groups\n"),
			   NULL, FALSE, FALSE, NULL, 
			   _("Search"), G_CALLBACK(_qq_group_search_callback), 
			   _("Cancel"), G_CALLBACK(_qq_group_search_cancel_callback), 
			   gc);

	return qd->roomlist;
}
Пример #4
0
static GaimRoomlist *gaym_roomlist_get_list(GaimConnection * gc)
{
    struct gaym_conn *gaym;
    GList *fields = NULL;
    GaimRoomlistField *f;
    char *buf;

    gaym = gc->proto_data;

    if (gaym->roomlist) {
        gaim_roomlist_unref(gaym->roomlist);
    }

    gaym->roomlist = gaim_roomlist_new(gaim_connection_get_account(gc));

    f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Channel"),
                                "channel", FALSE);
    fields = g_list_prepend(fields, f);

    f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "",
                                "description", TRUE);
    fields = g_list_prepend(fields, f);

    gaim_roomlist_set_fields(gaym->roomlist, fields);

    /**
     * Member created rooms are retrieved through the IRC protocol
     * and after the last response is recieved from that request
     * the static rooms are added
     */

    buf = gaym_format(gaym, "v", "LIST #_*");
    gaym_send(gaym, buf);
    g_free(buf);

    return gaym->roomlist;
}