[330] in BarnOwl Developers
[D-O-H] r475 - / trunk/owl
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:04:59 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: Sun, 24 Dec 2006 18:26:41 -0500 (EST)
Author: nelhage
Date: 2006-12-24 18:26:33 -0500 (Sun, 24 Dec 2006)
New Revision: 475
Modified:
/
trunk/owl/functions.c
trunk/owl/owl.c
trunk/owl/zephyr.c
Log:
r15874@phanatique: nelhage | 2006-12-24 18:25:33 -0500
Don't quit if we can't contact the hostmaster.
Property changes on:
___________________________________________________________________
Name: svk:merge
- 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24121
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:15872
+ 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24121
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:15874
Modified: trunk/owl/functions.c
===================================================================
--- trunk/owl/functions.c 2006-12-24 23:23:29 UTC (rev 474)
+++ trunk/owl/functions.c 2006-12-24 23:26:33 UTC (rev 475)
@@ -3261,51 +3261,57 @@
#ifdef HAVE_LIBZEPHYR
if (zephyr) {
- owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n");
- owl_list_create(&anyone);
- ret=owl_zephyr_get_anyone_list(&anyone, filename);
- if (ret) {
- owl_fmtext_append_normal(&fm, " Error opening file for zephyr buddies.\n");
+ if(!owl_global_is_havezephyr(&g)) {
+ owl_function_error("Zephyr currently not available.");
} else {
- j=owl_list_get_size(&anyone);
- for (i=0; i<j; i++) {
- user=owl_list_get_element(&anyone, i);
- ret=ZLocateUser(user, &numlocs, ZAUTH);
- if (ret!=ZERR_NONE) {
- owl_function_error("Error getting location for %s", user);
- continue;
- }
-
- numlocs=200;
- ret=ZGetLocations(location, &numlocs);
- if (ret==0) {
- for (x=0; x<numlocs; x++) {
- line=malloc(strlen(location[x].host)+strlen(location[x].time)+strlen(location[x].tty)+100);
- tmp=short_zuser(user);
- sprintf(line, " %-10.10s %-24.24s %-12.12s %20.20s\n",
- tmp,
- location[x].host,
- location[x].tty,
- location[x].time);
- owl_fmtext_append_normal(&fm, line);
- owl_free(tmp);
- owl_free(line);
- }
- if (numlocs>=200) {
- owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n");
- }
- }
+ owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n");
+ owl_list_create(&anyone);
+ ret=owl_zephyr_get_anyone_list(&anyone, filename);
+ if (ret) {
+ owl_fmtext_append_normal(&fm, " Error opening file for zephyr buddies.\n");
+ } else {
+ j=owl_list_get_size(&anyone);
+ for (i=0; i<j; i++) {
+ user=owl_list_get_element(&anyone, i);
+ ret=ZLocateUser(user, &numlocs, ZAUTH);
+ if (ret!=ZERR_NONE) {
+ owl_function_error("Error getting location for %s", user);
+ continue;
+ }
+
+ numlocs=200;
+ ret=ZGetLocations(location, &numlocs);
+ if (ret==0) {
+ for (x=0; x<numlocs; x++) {
+ line=malloc(strlen(location[x].host)+strlen(location[x].time)+strlen(location[x].tty)+100);
+ tmp=short_zuser(user);
+ sprintf(line, " %-10.10s %-24.24s %-12.12s %20.20s\n",
+ tmp,
+ location[x].host,
+ location[x].tty,
+ location[x].time);
+ owl_fmtext_append_normal(&fm, line);
+ owl_free(tmp);
+ owl_free(line);
+ }
+ if (numlocs>=200) {
+ owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n");
+ }
+ }
+ }
}
- }
- owl_list_free_all(&anyone, owl_free);
+ owl_list_free_all(&anyone, owl_free);
+ }
}
#endif
- if(owl_perlconfig_is_function("owl::get_blist")) {
- char * perlblist = owl_perlconfig_execute("owl::get_blist()");
- if(perlblist) {
- owl_fmtext_append_ztext(&fm, perlblist);
- owl_free(perlblist);
+ if(aim && zephyr) {
+ if(owl_perlconfig_is_function("owl::get_blist")) {
+ char * perlblist = owl_perlconfig_execute("owl::get_blist()");
+ if(perlblist) {
+ owl_fmtext_append_ztext(&fm, perlblist);
+ owl_free(perlblist);
+ }
}
}
Modified: trunk/owl/owl.c
===================================================================
--- trunk/owl/owl.c 2006-12-24 23:23:29 UTC (rev 474)
+++ trunk/owl/owl.c 2006-12-24 23:26:33 UTC (rev 475)
@@ -143,9 +143,8 @@
#ifdef HAVE_LIBZEPHYR
/* zephyr init */
ret=owl_zephyr_initialize();
- if (ret) {
- exit(1);
- }
+ if (!ret)
+ owl_global_set_havezephyr(&g);
#endif
/* signal handler */
@@ -200,9 +199,6 @@
if (debug) owl_global_set_debug_on(&g);
owl_function_debugmsg("startup: first available debugging message");
owl_global_set_startupargs(&g, argcsave, argvsave);
-#ifdef HAVE_LIBZEPHYR
- owl_global_set_havezephyr(&g);
-#endif
owl_global_set_haveaim(&g);
#if OWL_STDERR_REDIR
Modified: trunk/owl/zephyr.c
===================================================================
--- trunk/owl/zephyr.c 2006-12-24 23:23:29 UTC (rev 474)
+++ trunk/owl/zephyr.c 2006-12-24 23:26:33 UTC (rev 475)
@@ -33,8 +33,10 @@
int owl_zephyr_shutdown()
{
#ifdef HAVE_LIBZEPHYR
- unsuball();
- ZClosePort();
+ if(owl_global_is_havezephyr(&g)) {
+ unsuball();
+ ZClosePort();
+ }
#endif
return(0);
}
@@ -42,7 +44,10 @@
int owl_zephyr_zpending()
{
#ifdef HAVE_LIBZEPHYR
- return(ZPending());
+ if(owl_global_is_havezephyr(&g))
+ return(ZPending());
+ else
+ return 0;
#else
return(0);
#endif