implement news->remove_msg()
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 27 Jan 2002 14:32:18 +0000 (14:32 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 27 Jan 2002 14:32:18 +0000 (14:32 +0000)
ChangeLog.claws
configure.in
src/folder.c
src/news.c

index c490a8d08caaf62a4a00840fef6e29561875d47e..5012b2cbf4922d5e4ca3272b7aaec40091412d8a 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-27 [alfons]    0.7.0claws33
+
+       * src/folder.c
+               add extra checks
+       * src/news.c
+               implement remove_msg() 
+
 2002-01-27 [alfons]    0.7.0claws32
 
        * src/procmsg.h
index 45412b7e6a9d792ea3ad2e3fb21329d0705ea7e3..5aa77272d81d120160f609a027156f1a233f9a5b 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws32
+EXTRA_VERSION=claws33
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4ee984c6facad263f3e9a9e45bb7132e8dc2d100..31f702aa62e43b76c6c03196b4b6dcf8d207513d 100644 (file)
@@ -680,8 +680,11 @@ gint folder_item_move_msg(FolderItem *dest, MsgInfo *msginfo)
        src_folder = msginfo->folder->folder;
 
        num = folder->copy_msg(folder, dest, msginfo);
-
+       
        if (num != -1) {
+               /* CLAWS */
+               g_assert(src_folder);
+               g_assert(src_folder->remove_msg);
                src_folder->remove_msg(src_folder,
                                       msginfo->folder,
                                       msginfo->msgnum);
index 086b369cb00b7d92e10b9933e0e8ed5bd3ce1851..abb3de5123b26171fbce9cfb591600d73117f3bb 100644 (file)
@@ -85,6 +85,9 @@ static GSList *news_delete_old_articles        (GSList        *alist,
                                          gint           first);
 static void news_delete_all_articles    (FolderItem    *item);
 
+static gint news_remove_msg             (Folder        *folder, 
+                                         FolderItem    *item, 
+                                         gint           num);
 
 Folder *news_folder_new(const gchar *name, const gchar *path)
 {
@@ -111,6 +114,7 @@ static void news_folder_init(Folder *folder, const gchar *name,
        folder->get_msg_list = news_get_article_list;
        folder->fetch_msg    = news_fetch_msg;
        folder->scan         = news_scan_group;
+       folder->remove_msg   = news_remove_msg;
 }
 
 static Session *news_session_new(const gchar *server, gushort port,
@@ -503,6 +507,25 @@ static gint news_get_article_cmd(NNTPSession *session, const gchar *cmd,
        return 0;
 }
 
+static gint news_remove_msg(Folder *folder, FolderItem *item, gint num)
+{
+       gchar *file;
+
+       g_return_val_if_fail(item != NULL, -1);
+
+       file = news_fetch_msg(folder, item, num);
+       g_return_val_if_fail(file != NULL, -1);
+
+       if (unlink(file) < 0) {
+               FILE_OP_ERROR(file, "unlink");
+               g_free(file);
+               return -1;
+       }
+
+       g_free(file);
+       return 0;
+}
+
 static gint news_get_article(NNTPSession *session, gint num, gchar *filename)
 {
        return news_get_article_cmd(session, "ARTICLE", num, filename);