0.8.9claws2

* po/POTFILES.in
        add pluginwindow and prefswindow
* src/compose.c
        make send respond correctly to messages that could be added
        to the queue folder, but the UID of the message is unknown
* src/folder.c
* src/imap.c
        don't return guessed UIDs in imap_add_msg anymore. We return
        0 to tell the folder system it was appened but the UID is
        unknown. Folder system now get's the UID by scaning the folder
        and searching the cache for the Message-ID
This commit is contained in:
Christoph Hohmann 2003-01-25 01:09:14 +00:00
parent 37394bd64d
commit 53d7204eb7
6 changed files with 67 additions and 13 deletions

View file

@ -1,3 +1,17 @@
2001-01-25 [christoph] 0.8.9claws2
* po/POTFILES.in
add pluginwindow and prefswindow
* src/compose.c
make send respond correctly to messages that could be added
to the queue folder, but the UID of the message is unknown
* src/folder.c
* src/imap.c
don't return guessed UIDs in imap_add_msg anymore. We return
0 to tell the folder system it was appened but the UID is
unknown. Folder system now get's the UID by scaning the folder
and searching the cache for the Message-ID
2001-01-25 [paul] 0.8.9claws1
* codeconv.c

View file

@ -11,7 +11,7 @@ MINOR_VERSION=8
MICRO_VERSION=9
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=claws1
EXTRA_VERSION=claws2
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target

View file

@ -77,3 +77,5 @@ src/string_match.c
src/summary_search.c
src/summaryview.c
src/toolbar.c
src/gtk/pluginwindow.c
src/gtk/prefswindow.c

View file

@ -2818,6 +2818,11 @@ gint compose_send(Compose *compose)
alertpanel_error(_("Could not queue message for sending"));
return -1;
}
if (msgnum == 0) {
alertpanel_error(_("The message was queue but could not be send.\nUse \"Send queued messages\" from the main window to send it"));
return 0;
}
msgpath = folder_item_fetch_msg(folder, msgnum);
val = procmsg_send_message_queue(msgpath);

View file

@ -1458,6 +1458,40 @@ gchar *folder_item_fetch_msg(FolderItem *item, gint num)
return folder->fetch_msg(folder, item, num);
}
static gint folder_item_get_msg_num_by_file(FolderItem *dest, const gchar *file)
{
static HeaderEntry hentry[] = {{"Message-ID:", NULL, TRUE},
{NULL, NULL, FALSE}};
FILE *fp;
MsgInfo *msginfo;
gint msgnum = 0;
gchar buf[BUFFSIZE];
if ((fp = fopen(file, "rb")) == NULL)
return 0;
if ((dest->stype == F_QUEUE) || (dest->stype == F_DRAFT))
while (fgets(buf, sizeof(buf), fp) != NULL)
if (buf[0] == '\r' || buf[0] == '\n') break;
procheader_get_header_fields(fp, hentry);
if (hentry[0].body) {
extract_parenthesis(hentry[0].body, '<', '>');
remove_space(hentry[0].body);
if ((msginfo = msgcache_get_msg_by_id(dest->cache, hentry[0].body)) != NULL) {
msgnum = msginfo->msgnum;
procmsg_msginfo_free(msginfo);
debug_print("found message as uid %d\n", msgnum);
}
}
g_free(hentry[0].body);
fclose(fp);
return msgnum;
}
gint folder_item_add_msg(FolderItem *dest, const gchar *file,
gboolean remove_source)
{
@ -1475,7 +1509,7 @@ gint folder_item_add_msg(FolderItem *dest, const gchar *file,
if (!dest->cache)
folder_item_read_cache(dest);
num = folder->add_msg(folder, dest, file, remove_source);
num = folder->add_msg(folder, dest, file, FALSE);
if (num > 0) {
msginfo = folder->get_msginfo(folder, dest, num);
@ -1498,7 +1532,15 @@ gint folder_item_add_msg(FolderItem *dest, const gchar *file,
}
dest->last_num = num;
}
} else if (num == 0) {
folder_item_scan(dest);
num = folder_item_get_msg_num_by_file(dest, file);
}
if (num >= 0 && remove_source) {
if (unlink(file) < 0)
FILE_OP_ERROR(file, "unlink");
}
return num;
}

View file

@ -752,8 +752,6 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
{
gchar *destdir;
IMAPSession *session;
gint messages, recent, unseen;
guint32 uid_next, uid_validity;
gint ok;
g_return_val_if_fail(folder != NULL, -1);
@ -763,13 +761,6 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
session = imap_session_get(folder);
if (!session) return -1;
ok = imap_status(session, IMAP_FOLDER(folder), dest->path,
&messages, &recent, &uid_next, &uid_validity, &unseen);
if (ok != IMAP_SUCCESS) {
g_warning("can't append message %s\n", file);
return -1;
}
destdir = imap_get_real_path(IMAP_FOLDER(folder), dest->path);
ok = imap_cmd_append(SESSION(session)->sock, destdir, file);
g_free(destdir);
@ -784,7 +775,7 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
FILE_OP_ERROR(file, "unlink");
}
return uid_next;
return 0;
}
static gint imap_do_copy(Folder *folder, FolderItem *dest, MsgInfo *msginfo,