Beispiel #1
0
void update_buddy_typing_cb(GaimAccount *account, const char *who)
{
	GaimConversation *gConv = NULL;

	gConv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, account);
	if (!gConv)
		return;

	GaimChatMngr::UpdateBuddyTyping(gConv, gaim_conv_im_get_typing_state(GAIM_CONV_IM(gConv)));
}
Beispiel #2
0
static void dequeue_message(GtkTreeIter *iter)
{
	gchar *name;
	GSList *templist;
	GaimConversation *cnv;
	gboolean orig_while_away;

	orig_while_away = gaim_prefs_get_bool("/core/sound/while_away");
	if (orig_while_away)
		gaim_prefs_set_bool("/core/sound/while_away", FALSE);

	gtk_tree_model_get(GTK_TREE_MODEL(awayqueuestore), iter, 0, &name, -1);

	gaim_debug(GAIM_DEBUG_INFO, "away", "Dequeueing messages from %s.\n",
			   name);

	templist = message_queue;

	while (templist) {
		struct queued_message *qm = templist->data;
		if (templist->data) {
			if (!gaim_utf8_strcasecmp(qm->name, name)) {
				GaimAccount *account = NULL;

				if (g_list_index(gaim_accounts_get_all(), qm->account) >= 0)
					account = qm->account;

				cnv = gaim_find_conversation_with_account(name, account);

				if (!cnv)
					cnv = gaim_conversation_new(GAIM_CONV_IM, account, qm->name);
				else
					gaim_conversation_set_account(cnv, account);

				gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, qm->message,
						qm->flags, qm->tm);
				g_free(qm->message);
				g_free(qm);
				templist = message_queue = g_slist_remove(message_queue, qm);

			} else {
				templist = templist->next;
			}
		}
	}

	g_free(name);
	/* In GTK 2.2, _store_remove actually returns whether iter is valid or not
	 * after the remove, but in GTK 2.0 it is a void function. */
	gtk_list_store_remove(awayqueuestore, iter);

	if (orig_while_away)
		gaim_prefs_set_bool("/core/sound/while_away", orig_while_away);
}
Beispiel #3
0
static void
buddy_typing_cb(GaimConversation *conv, void *data)
{
	GaimAccount *account = gaim_conversation_get_account(conv);
	const char *name     = gaim_conversation_get_name(conv);

	if (gaim_find_buddy(account, name) != NULL)
	{
		GaimPounceEvent event;

		event = (gaim_conv_im_get_typing_state(GAIM_CONV_IM(conv)) == GAIM_TYPING
				 ? GAIM_POUNCE_TYPING : GAIM_POUNCE_TYPING_STOPPED);

		gaim_pounce_execute(account, name, event);
	}
}
Beispiel #4
0
void purge_away_queue(GSList **queue)
{
	GSList *q = *queue;
	struct queued_message *qm;
	GaimConversation *cnv;
	GaimAccount *account;
	gboolean orig_while_away;

	orig_while_away = gaim_prefs_get_bool("/core/sound/while_away");
	if (orig_while_away)
		gaim_prefs_set_bool("/core/sound/while_away", FALSE);

	while (q) {
		qm = q->data;

		account = NULL;

		if (g_list_index(gaim_accounts_get_all(), qm->account) >= 0)
			account = qm->account;

		cnv = gaim_find_conversation_with_account(qm->name, account);

		if (!cnv)
			cnv = gaim_conversation_new(GAIM_CONV_IM, account, qm->name);
		else
			gaim_conversation_set_account(cnv, account);

		gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, qm->message, qm->flags, qm->tm);

		g_free(qm->message);
		g_free(qm);

		q->data = NULL;
		q = q->next;
	}

	g_slist_free(*queue);
	*queue = NULL;

	if (orig_while_away)
		gaim_prefs_set_bool("/core/sound/while_away", orig_while_away);
}
gboolean go(GaimConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data)
{
	gaim_conv_im_send(GAIM_CONV_IM(conv), code);

	return GAIM_CMD_STATUS_OK;
}