/soc/2015/igor.gajowiak/chatlog: f9dcd262c990: Implemented wipe ...

Igor Gajowiak <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: f9dcd262c990cc0ffdda22dcd2915741185c259e
Author:	 Igor Gajowiak <[email protected]>
Date:	 2015-08-01 20:26 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/igor.gajowiak/chatlog/rev/f9dcd262c990

Description:

Implemented wipe log for buddy button.

diffstat:

 pidgin/gtkgenericlog.c |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (33 lines):

diff --git a/pidgin/gtkgenericlog.c b/pidgin/gtkgenericlog.c
--- a/pidgin/gtkgenericlog.c
+++ b/pidgin/gtkgenericlog.c
@@ -188,7 +188,28 @@ on_start_conversation_item_clicked(GtkAc
 static void
 on_wipe_log_for_buddy_item_clicked(GtkAction *action, gpointer data)
 {
-	printf("on_wipe_log_for_buddy_item_clicked\n");
+	g_assert(data);
+
+	PidginGenericLogViewer *viewer = (PidginGenericLogViewer*) data;
+
+	PurpleBuddy *buddy = viewer->current_buddy;
+	g_return_if_fail(buddy != NULL);
+
+	if (!purple_genericlog_wipe_log_for_buddy(buddy, NULL)) {
+		purple_debug_error(GTKGENERICLOG_DEBUG_CATEGORY,
+			"Wiping log for buddy failed");
+		return;
+	}
+
+	GtkTreeSelection *sel = gtk_tree_view_get_selection(
+		GTK_TREE_VIEW(viewer->blist_tree_view));
+	g_return_if_fail(sel != NULL);
+
+	GtkTreeIter row;
+	gboolean selected = gtk_tree_selection_get_selected(sel, NULL, &row);
+	g_return_if_fail(selected);
+
+	gtk_tree_store_remove(viewer->blist_tree_store, &row);
 }
 
 static GtkWidget *

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.