[826] in BarnOwl Developers
[D-O-H] r820 - trunk/owl
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:10:07 2009
Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Thu, 10 Jan 2008 01:16:34 -0500 (EST)
Author: nelhage
Date: 2008-01-10 01:16:33 -0500 (Thu, 10 Jan 2008)
New Revision: 820
Modified:
trunk/owl/zephyr.c
Log:
Handle zephyrs to users on non -c message better (fixes #39)
Modified: trunk/owl/zephyr.c
===================================================================
--- trunk/owl/zephyr.c 2008-01-10 06:02:06 UTC (rev 819)
+++ trunk/owl/zephyr.c 2008-01-10 06:16:33 UTC (rev 820)
@@ -562,16 +562,25 @@
owl_function_makemsg("Message sent to -c %s -i %s\n", retnotice->z_class, retnotice->z_class_inst);
}
} else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) {
- if (strcasecmp(retnotice->z_class, "message")) {
+ if (retnotice->z_recipient == NULL
+ || *retnotice->z_recipient == NULL
+ || *retnotice->z_recipient == '@') {
char buff[1024];
- owl_function_error("No one subscribed to class class %s", retnotice->z_class);
+ owl_function_error("No one subscribed to class %s", retnotice->z_class);
sprintf(buff, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class);
owl_function_adminmsg("", buff);
} else {
char buff[1024];
tmp = short_zuser(retnotice->z_recipient);
- owl_function_error("%s: Not logged in or subscribing to messages.", tmp);
- sprintf(buff, "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);
+ sprintf(buff, "Could not send message to %s: not logged in or subscribing to", tmp);
+ if(strcmp(retnotice->z_class, "message")) {
+ sprintf(buff, "%s class %s, instance %s.\n", buff,
+ retnotice->z_class,
+ retnotice->z_class_inst);
+ } else {
+ sprintf(buff, "%s messages.\n", buff);
+ }
owl_function_adminmsg("", buff);
owl_log_outgoing_zephyr_error(tmp, buff);
owl_free(tmp);