Index: functions.c
===================================================================
--- functions.c	(revision c809f5e8a3cc2745724f518c89b09279b5508b02)
+++ functions.c	(revision e5da3fe3addbd16cf3a528bb6ac04d487f746afc)
@@ -250,17 +250,26 @@
 }
 
-/* Create an outgoing zephyr message and return a pointer to it.  Does
- * not put it on the global queue, use owl_global_messagequeue_addmsg() for
- * that.
+/* Queues outgoing zephyrs; if z sends to n people, queue n messages
+ * (except in case of cc). If there are no recipients queues 1
+ * message.
  */
-owl_message *owl_function_make_outgoing_zephyr(const owl_zwrite *z)
-{
-  owl_message *m;
-
-  /* create the message */
-  m=g_new(owl_message, 1);
-  owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z));
-
-  return(m);
+void owl_function_add_outgoing_zephyrs(const owl_zwrite *z)
+{
+  if (z->cc || owl_zwrite_get_numrecips(z) == 0) {
+    /* create the message */
+    owl_message *m = g_new(owl_message, 1);
+    owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), 0);
+
+    owl_global_messagequeue_addmsg(&g, m);
+  } else {
+    int i;
+    for (i = 0; i < owl_zwrite_get_numrecips(z); i++) {
+      /* create the message */
+      owl_message *m = g_new(owl_message, 1);
+      owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i);
+
+      owl_global_messagequeue_addmsg(&g, m);
+    }
+  }
 }
 
@@ -268,5 +277,5 @@
  * message or NULL if we're not logged into AIM (and thus unable to
  * create the message).  Does not put it on the global queue.  Use
- * owl_global_messagequeue_addmsg() for that .
+ * owl_global_messagequeue_addmsg() for that.
  */
 owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
@@ -378,11 +387,10 @@
 }
 
-/* send, log and display an outgoing zephyr.  If 'msg' is NULL
- * the message is expected to be set from the zwrite line itself
+/* send, log and display outgoing zephyrs.  If 'msg' is NULL the
+ * message is expected to be set from the zwrite line itself
  */
 #ifdef HAVE_LIBZEPHYR
 void owl_function_zwrite(owl_zwrite *z, const char *msg)
 {
-  owl_message *m;
   int ret;
 
@@ -407,11 +415,5 @@
   if (owl_zwrite_is_personal(z)) {
     /* create the outgoing message */
-    m=owl_function_make_outgoing_zephyr(z);
-
-    if (m) {
-      owl_global_messagequeue_addmsg(&g, m);
-    } else {
-      owl_function_error("Could not create outgoing zephyr message");
-    }
+    owl_function_add_outgoing_zephyrs(z);
   }
 }
@@ -421,5 +423,5 @@
 #endif
 
-/* send, log and display an outgoing zcrypt zephyr.  If 'msg' is NULL
+/* send, log and display outgoing zcrypt zephyrs.  If 'msg' is NULL
  * the message is expected to be set from the zwrite line itself
  */
@@ -427,5 +429,4 @@
 {
   char *cryptmsg;
-  owl_message *m;
   const char *argv[7];
   char *zcrypt;
@@ -469,10 +470,5 @@
     /* Create the outgoing message. Restore the un-crypted message for display. */
     owl_zwrite_set_message_raw(z, old_msg);
-    m=owl_function_make_outgoing_zephyr(z);
-    if (m) {
-      owl_global_messagequeue_addmsg(&g, m);
-    } else {
-      owl_function_error("Could not create outgoing zephyr message");
-    }
+    owl_function_add_outgoing_zephyrs(z);
   }
 
Index: logging.c
===================================================================
--- logging.c	(revision e3a75ed002d36684faf777a949ef38ff9552b73f)
+++ logging.c	(revision e5da3fe3addbd16cf3a528bb6ac04d487f746afc)
@@ -186,5 +186,6 @@
    */
   m = g_new(owl_message, 1);
-  owl_message_create_from_zwrite(m, zw, text);
+  /* recip_index = 0 because there can only be one recipient anyway */
+  owl_message_create_from_zwrite(m, zw, text, 0);
   if (!owl_log_shouldlog_message(m)) {
     owl_message_delete(m);
Index: message.c
===================================================================
--- message.c	(revision f54b07d89051a95846d26991aeb7e8b4cd630aff)
+++ message.c	(revision e5da3fe3addbd16cf3a528bb6ac04d487f746afc)
@@ -958,5 +958,5 @@
 }
 
-void owl_message_create_from_zwrite(owl_message *m, const owl_zwrite *z, const char *body)
+void owl_message_create_from_zwrite(owl_message *m, const owl_zwrite *z, const char *body, int recip_index)
 {
   char *replyline;
@@ -970,8 +970,7 @@
   owl_message_set_class(m, owl_zwrite_get_class(z));
   owl_message_set_instance(m, owl_zwrite_get_instance(z));
-  if (owl_zwrite_get_numrecips(z)>0) {
-    char *longzuser = long_zuser(owl_zwrite_get_recip_n(z, 0));
-    owl_message_set_recipient(m,
-			      longzuser); /* only gets the first user, must fix */
+  if (recip_index < owl_zwrite_get_numrecips(z)) {
+    char *longzuser = long_zuser(owl_zwrite_get_recip_n(z, recip_index));
+    owl_message_set_recipient(m, longzuser);
     g_free(longzuser);
   }
Index: zephyr.c
===================================================================
--- zephyr.c	(revision 7d969f31f2bcc9221bbf3a80d3eea1607670719f)
+++ zephyr.c	(revision e5da3fe3addbd16cf3a528bb6ac04d487f746afc)
@@ -851,5 +851,4 @@
 #ifdef HAVE_LIBZEPHYR
   char *tmpbuff, *myuser, *to;
-  owl_message *mout;
   owl_zwrite *z;
   
@@ -898,6 +897,5 @@
 
   /* display the message as an admin message in the receive window */
-  mout=owl_function_make_outgoing_zephyr(z);
-  owl_global_messagequeue_addmsg(&g, mout);
+  owl_function_add_outgoing_zephyrs(z);
   owl_zwrite_delete(z);
 #endif
