diff mcabber/src/screen.c @ 1485:0121b6f3047c

New command: /buffer save
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Apr 2008 16:06:37 +0200
parents 7b36b91a4388
children f83a51eaa5ed
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sun Apr 20 14:30:25 2008 +0200
+++ b/mcabber/src/screen.c	Sun Apr 20 16:06:37 2008 +0200
@@ -2703,6 +2703,25 @@
   update_panels();
 }
 
+void scr_BufferDump(const char *file)
+{
+  char *extfname;
+
+  if (!currentWindow) {
+    scr_LogPrint(LPRINT_NORMAL, "No current buffer!");
+    return;
+  }
+
+  if (!file || !*file) {
+    scr_LogPrint(LPRINT_NORMAL, "Missing parameter (file name)!");
+    return;
+  }
+
+  extfname = expand_filename(file);
+  hbuf_dump_to_file(currentWindow->bd->hbuf, extfname);
+  g_free(extfname);
+}
+
 //  buffer_list()
 // key: winId/jid
 // value: winbuf structure