Commit 3543c1ab 3543c1aba30a7dcd34f45d125955e4272b38096b by Sergey Poznyakoff

Use mh_.*_to_message.

1 parent 236984a1
Showing 1 changed file with 10 additions and 16 deletions
...@@ -230,7 +230,7 @@ opt_handler (int key, char *arg, void *unused) ...@@ -230,7 +230,7 @@ opt_handler (int key, char *arg, void *unused)
230 return 0; 230 return 0;
231 } 231 }
232 232
233 static int 233 static void
234 watch_printf (const char *fmt, ...) 234 watch_printf (const char *fmt, ...)
235 { 235 {
236 va_list ap; 236 va_list ap;
...@@ -249,24 +249,24 @@ draft_name() ...@@ -249,24 +249,24 @@ draft_name()
249 return mh_expand_name (draftfolder, "draft", 0); 249 return mh_expand_name (draftfolder, "draft", 0);
250 } 250 }
251 251
252 static list_t mbox_list; 252 static list_t mesg_list;
253 static mh_context_t *mts_profile; 253 static mh_context_t *mts_profile;
254 254
255 int 255 int
256 check_file (char *name) 256 check_file (char *name)
257 { 257 {
258 mailbox_t mbox; 258 message_t msg;
259 259
260 mbox = mh_open_msg_file (draft_folder, name); 260 msg = mh_file_to_message (draft_folder, name);
261 if (!mbox) 261 if (!msg)
262 return 1; 262 return 1;
263 if (!mbox_list && list_create (&mbox_list)) 263 if (!mesg_list && list_create (&mesg_list))
264 { 264 {
265 mh_error (_("can't create mailbox list")); 265 mh_error (_("can't create message list"));
266 return 1; 266 return 1;
267 } 267 }
268 268
269 return list_append (mbox_list, mbox); 269 return list_append (mesg_list, msg);
270 } 270 }
271 271
272 void 272 void
...@@ -343,19 +343,13 @@ create_message_id (header_t hdr) ...@@ -343,19 +343,13 @@ create_message_id (header_t hdr)
343 int 343 int
344 _action_send (void *item, void *data) 344 _action_send (void *item, void *data)
345 { 345 {
346 mailbox_t mbox = item; 346 message_t msg = item;
347 message_t msg;
348 int rc; 347 int rc;
349 mailer_t mailer; 348 mailer_t mailer;
350 header_t hdr; 349 header_t hdr;
351 size_t n; 350 size_t n;
352 351
353 WATCH(("Getting message")); 352 WATCH(("Getting message"));
354 if ((rc = mailbox_get_message (mbox, 1, &msg)))
355 {
356 mh_error(_("cannot get message: %s"), mu_strerror (rc));
357 return 1;
358 }
359 353
360 if (message_get_header (msg, &hdr) == 0) 354 if (message_get_header (msg, &hdr) == 0)
361 { 355 {
...@@ -427,7 +421,7 @@ send (int argc, char **argv) ...@@ -427,7 +421,7 @@ send (int argc, char **argv)
427 return 1; 421 return 1;
428 } 422 }
429 423
430 rc = list_do (mbox_list, _action_send, NULL); 424 rc = list_do (mesg_list, _action_send, NULL);
431 return rc; 425 return rc;
432 } 426 }
433 427
......