Index: zephyr.c
===================================================================
--- zephyr.c	(revision 6d7e6c6bd0f24513101bd81fdf431000c0799715)
+++ zephyr.c	(revision db654df38a0ca813d2259e1d1680f60809852c2c)
@@ -26,5 +26,4 @@
     return(1);
   }
-  owl_zephyr_process_events(NULL);
 #endif
   return(0);
@@ -36,5 +35,4 @@
 #ifdef HAVE_LIBZEPHYR
   unsuball();
-  owl_zephyr_process_events(NULL);
   ZClosePort();
 #endif
@@ -85,5 +83,4 @@
     owl_free(subs[i].zsub_recipient);
   }
-  owl_zephyr_process_events(NULL);
   return ret;
 }
@@ -116,4 +113,5 @@
   ret=stat(subsfile, &statbuff);
   if (ret) {
+    owl_function_debugmsg("loadsubs: could not stat file %s", subsfile)
     if (error_on_nofile==1) return(-1);
     return(0);
@@ -123,5 +121,8 @@
   count=0;
   file=fopen(subsfile, "r");
-  if (!file) return(-1);
+  if (!file) {
+    owl_function_debugmsg("loadsubs: could not open file %s", subsfile)
+    return(-1);
+  }
   while ( fgets(buffer, 1024, file)!=NULL ) {
     if (buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\n') continue;
@@ -176,5 +177,4 @@
     return(-1);
   }
-  owl_zephyr_process_events(NULL);
   return(0);
 #else
@@ -241,6 +241,4 @@
   }
 
-  owl_zephyr_process_events(NULL);
-
   return(ret);
 #else
@@ -276,5 +274,4 @@
     return(-2);
   }
-  owl_zephyr_process_events(NULL);
   return(0);
 #else
@@ -298,5 +295,4 @@
     return(-2);
   }
-  owl_zephyr_process_events(NULL);
   return(0);
 #else
@@ -468,5 +464,4 @@
   owl_free(notice.z_message);
   ZFreeNotice(&notice);
-  owl_zephyr_process_events(NULL);
   if (ret!=ZERR_NONE) {
     owl_function_error("Error sending zephyr");
@@ -484,5 +479,4 @@
   int ret;
   ret=ZSendPacket(buf, len, 0);
-  owl_zephyr_process_events(NULL);
   return(ret);
 }
@@ -493,5 +487,4 @@
 #ifdef HAVE_LIBZEPHYR
   send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, "");
-  owl_zephyr_process_events(NULL);
 #endif
 }
@@ -500,5 +493,5 @@
 void owl_zephyr_handle_ack(ZNotice_t *retnotice)
 {
-  char *tmp, *buff;
+  char *tmp;
   
   /* if it's an HMACK ignore it */
@@ -521,24 +514,36 @@
     }
   } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) {
-    if (strcasecmp(retnotice->z_class, "message")) {
-      owl_function_error("No one subscribed to class class %s", retnotice->z_class);
-      buff=owl_sprintf("Could not send message to class %s: no one subscribed.\n",
-		       retnotice->z_class);
+    #define BUFFLEN 1024
+    if (retnotice->z_recipient == NULL
+        || *retnotice->z_recipient == 0
+        || *retnotice->z_recipient == '@') {
+      char buff[BUFFLEN];
+      owl_function_error("No one subscribed to class %s", retnotice->z_class);
+      snprintf(buff, BUFFLEN, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class);
       owl_function_adminmsg("", buff);
-      owl_free(buff);
     } else {
+      char buff[BUFFLEN];
       tmp = short_zuser(retnotice->z_recipient);
-      owl_function_error("%s: Not logged in or subscribing to messages.", tmp);
-      buff=owl_sprintf("Could not send message to %s: not logged in or subscribing to messages.\n",
-		       tmp);
+      owl_function_error("%s: Not logged in or subscribing.", tmp);
+      if(strcmp(retnotice->z_class, "message")) {
+        snprintf(buff, BUFFLEN,
+                 "Could not send message to %s: "
+                 "not logged in or subscribing to class %s, instance %s.\n", 
+                 tmp,
+                 retnotice->z_class,
+                 retnotice->z_class_inst);
+      } else {
+        snprintf(buff, BUFFLEN,
+                 "Could not send message to %s: "
+                 "not logged in or subscribing to messages.\n",
+                 tmp);
+      }
       owl_function_adminmsg("", buff);
       owl_log_outgoing_zephyr_error(tmp, buff);
       owl_free(tmp);
-      owl_free(buff);
     }
   } else {
     owl_function_error("Internal error on ack (%s)", retnotice->z_message);
   }
-  owl_zephyr_process_events(NULL);
 }
 #else
@@ -635,5 +640,4 @@
   ZResetAuthentication();
   ret=ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH);
-  owl_zephyr_process_events(NULL);
   if (ret != ZERR_NONE) {
     return(owl_sprintf("Error locating user %s\n", user));
@@ -661,5 +665,4 @@
     owl_free(myuser);
   }
-  owl_zephyr_process_events(NULL);
   return(out);
 #else
@@ -866,5 +869,4 @@
       int tmpbufflen;
       char *tmpbuff;
-      owl_zephyr_process_events(NULL);
       tmpbuff = owl_sprintf("<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, out);
       tmpbufflen = strlen(tmpbuff) + 1;
@@ -888,5 +890,4 @@
 
   ZFlushSubscriptions();
-  owl_zephyr_process_events(NULL);
   return(out);
 #else
@@ -908,5 +909,4 @@
 #ifdef HAVE_LIBZEPHYR
   ZInitLocationInfo(host, val);
-  owl_zephyr_process_events(NULL);
 #endif
 }
