Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ ChangeLog	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -85,4 +85,6 @@
 	Added the 'startup' and 'unstartup' commands
 	The $HOME/.owl directory is created on startup if it does not exist
+	Added the 'aim_ingorelogin_timer' variable
+	'addbuddy zephyr <user>' and 'delbuddy zephyr <user>' now work.
 	
 1.2.8
Index: commands.c
===================================================================
--- commands.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
+++ commands.c	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -882,9 +882,4 @@
 char *owl_command_addbuddy(int argc, char **argv, char *buff)
 {
-  if (!owl_global_is_aimloggedin(&g)) {
-    owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
-    return(NULL);
-  }
-
   if (argc!=3) {
     owl_function_makemsg("usage: addbuddy <protocol> <buddyname>");
@@ -892,11 +887,17 @@
   }
 
-  if (strcasecmp(argv[1], "aim")) {
-    owl_function_makemsg("addbuddy: currently the only supported protocol is 'aim'");
-    return(NULL);
-  }
-
-  owl_aim_addbuddy(argv[2]);
-  owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
+  if (!strcasecmp(argv[1], "aim")) {
+    if (!owl_global_is_aimloggedin(&g)) {
+      owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
+      return(NULL);
+    }
+    owl_aim_addbuddy(argv[2]);
+    owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
+  } else if (!strcasecmp(argv[1], "zephyr")) {
+    owl_zephyr_addbuddy(argv[2]);
+    owl_function_makemsg("%s added as zephyr buddy", argv[2]);
+  } else {
+    owl_function_makemsg("addbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
+  }
 
   return(NULL);
@@ -905,9 +906,4 @@
 char *owl_command_delbuddy(int argc, char **argv, char *buff)
 {
-  if (!owl_global_is_aimloggedin(&g)) {
-    owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
-    return(NULL);
-  }
-
   if (argc!=3) {
     owl_function_makemsg("usage: delbuddy <protocol> <buddyname>");
@@ -915,11 +911,18 @@
   }
 
-  if (strcasecmp(argv[1], "aim")) {
-    owl_function_makemsg("delbuddy: currently the only supported protocol is 'aim'");
-    return(NULL);
-  }
-
-  owl_aim_delbuddy(argv[2]);
-  owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
+  if (!strcasecmp(argv[1], "aim")) {
+    if (!owl_global_is_aimloggedin(&g)) {
+      owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
+      return(NULL);
+    }
+    owl_aim_delbuddy(argv[2]);
+    owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
+  } else if (!strcasecmp(argv[1], "zephyr")) {
+    owl_zephyr_delbuddy(argv[2]);
+    owl_function_makemsg("%s deleted as zephyr buddy", argv[2]);
+  } else {
+    owl_function_makemsg("delbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
+  }
+
 
   return(NULL);
Index: owl.h
===================================================================
--- owl.h	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
+++ owl.h	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -248,5 +248,5 @@
   int delete;
   char hostname[MAXHOSTNAMELEN];
-  owl_list attributes; /* this is a list of pairs */
+  owl_list attributes;            /* this is a list of pairs */
   char *time;
   char *zwriteline;
Index: owl_prototypes.h
===================================================================
--- owl_prototypes.h	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
+++ owl_prototypes.h	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -969,4 +969,6 @@
 extern void owl_zephyr_zlog_in(void);
 extern void owl_zephyr_zlog_out(void);
+extern void owl_zephyr_addbuddy(char *name);
+extern void owl_zephyr_delbuddy(char *name);
 
 /* -------------------------------- zwrite.c -------------------------------- */
Index: util.c
===================================================================
--- util.c	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ util.c	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -704,5 +704,5 @@
     if (backup) fputs(buff, backupfile);
   }
-  fclose(backupfile);
+  if (backup) fclose(backupfile);
   fclose(file);
 
Index: zephyr.c
===================================================================
--- zephyr.c	(revision 31e48a31baadb6973aeafc691fec373040f39690)
+++ zephyr.c	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
@@ -607,2 +607,26 @@
 }
 
+void owl_zephyr_addbuddy(char *name)
+{
+  char *filename;
+  FILE *file;
+  
+  filename=owl_sprintf("%s/.anyone", owl_global_get_homedir(&g));
+  file=fopen(filename, "a");
+  owl_free(filename);
+  if (!file) {
+    owl_function_makemsg("Error opening zephyr buddy file for append");
+    return;
+  }
+  fprintf(file, "%s\n", name);
+  fclose(file);
+}
+
+void owl_zephyr_delbuddy(char *name)
+{
+  char *filename;
+
+  filename=owl_sprintf("%s/.anyone", owl_global_get_homedir(&g));
+  owl_util_file_deleteline(filename, name, 0);
+  owl_free(filename);
+}
