Exemple #1
0
/* void ggp_confer_participants_add(PurpleConnection *gc, const gchar *chat_name, const uin_t *recipients, int count) {{{ */
void ggp_confer_participants_add(PurpleConnection *gc, const gchar *chat_name,
				 const uin_t *recipients, int count)
{
	GGPInfo *info = gc->proto_data;
	GList *l;
	gchar *str_uin;

	for (l = info->chats; l != NULL; l = l->next) {
		GGPChat *chat = l->data;
		int i;

		if (g_utf8_collate(chat->name, chat_name) != 0)
			continue;

		for (i = 0; i < count; i++) {
			PurpleConversation *conv;

			if (g_list_find(chat->participants,
					GINT_TO_POINTER(recipients[i])) != NULL) {
				continue;
			}

			chat->participants = g_list_append(chat->participants,
							   GINT_TO_POINTER(recipients[i]));

			str_uin = g_strdup_printf("%lu", (unsigned long int)recipients[i]);
			conv = ggp_confer_find_by_name(gc, chat_name);
			purple_conv_chat_add_user(PURPLE_CONV_CHAT(conv),
						str_uin, NULL,
						PURPLE_CBFLAGS_NONE, TRUE);
			g_free(str_uin);
		}
		break;
	}
}
Exemple #2
0
/* void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name, const uin_t uin) {{{ */
void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name,
							 const uin_t uin)
{
	GaimConversation *conv;
	GGPInfo *info = gc->proto_data;
	GGPChat *chat;
	GList *l;
	gchar *str_uin;

	for (l = info->chats; l != NULL; l = l->next) {
		chat = l->data;

		if (g_utf8_collate(chat->name, chat_name) != 0)
			continue;

		if (g_list_find(chat->participants, GINT_TO_POINTER(uin)) == NULL) {
			chat->participants = g_list_append(
						chat->participants, GINT_TO_POINTER(uin));

			str_uin = g_strdup_printf("%lu", (unsigned long int)uin);
			conv = ggp_confer_find_by_name(gc, chat_name);
			gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv), str_uin, NULL,
						GAIM_CBFLAGS_NONE, TRUE);

			g_free(str_uin);
		}
		break;
	}
}