Index: Makefile.in
===================================================================
--- Makefile.in	(revision aa5f725832e087e7a8c053b6d238f21fae14500b)
+++ Makefile.in	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -23,5 +23,5 @@
      regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
      keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
-     aim.c buddylist.c
+     aim.c buddylist.c timer.c
 OWL_SRC = owl.c
 TESTER_SRC = tester.c
Index: aim.c
===================================================================
--- aim.c	(revision fd93b41172517bb322cb0ade63533aed2cc51429)
+++ aim.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -1409,4 +1409,7 @@
   va_end(ap);
 
+  /* first check that we're not still ignoreing login messages */
+  if (!owl_timer_is_expired(owl_global_get_aim_login_timer(&g))) return;
+  
   owl_buddylist_oncoming(owl_global_get_buddylist(&g), userinfo->sn);
   
Index: commands.c
===================================================================
--- commands.c	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ commands.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -1931,4 +1931,9 @@
   if (!ret) {
     owl_function_makemsg("%s logged in.\n", argv[1]);
+
+    /* start the ingorelogin timer */
+    owl_timer_reset_newstart(owl_global_get_aim_login_timer(&g),
+			     owl_global_get_aim_ignorelogin_timer(&g));
+    
     return(NULL);
   }
Index: global.c
===================================================================
--- global.c	(revision aa5f725832e087e7a8c053b6d238f21fae14500b)
+++ global.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -91,6 +91,6 @@
   g->aim_screenname=NULL;
   g->aim_loggedin=0;
-  g->aim_lastnop=0;
-
+  owl_timer_create_countdown(&(g->aim_noop_timer), 30);
+  owl_timer_create_countdown(&(g->aim_ignorelogin_timer), 0);
   owl_buddylist_init(&(g->buddylist));
 }
@@ -647,14 +647,17 @@
 /* AIM stuff */
 
-int owl_global_is_aimloggedin(owl_global *g) {
+int owl_global_is_aimloggedin(owl_global *g)
+{
   if (g->aim_loggedin) return(1);
   return(0);
 }
 
-char *owl_global_get_aim_screenname(owl_global *g) {
+char *owl_global_get_aim_screenname(owl_global *g)
+{
   return (g->aim_screenname);
 }
 
-void owl_global_set_aimloggedin(owl_global *g, char *screenname) {
+void owl_global_set_aimloggedin(owl_global *g, char *screenname)
+{
   g->aim_loggedin=1;
   if (g->aim_screenname) owl_free(g->aim_screenname);
@@ -662,41 +665,39 @@
 }
 
-void owl_global_set_aimnologgedin(owl_global *g) {
+void owl_global_set_aimnologgedin(owl_global *g)
+{
   g->aim_loggedin=0;
 }
 
-aim_session_t *owl_global_get_aimsess(owl_global *g) {
+aim_session_t *owl_global_get_aimsess(owl_global *g)
+{
   return(&(g->aimsess));
 }
 
-aim_conn_t *owl_global_get_waitingconn(owl_global *g) {
+aim_conn_t *owl_global_get_waitingconn(owl_global *g)
+{
   return(&(g->waitingconn));
 }
 
-int owl_global_is_aimnop_time(owl_global *g) {
-  time_t now;
-
-  now=time(NULL);
-  if (g->aim_lastnop==0) {
-    g->aim_lastnop=now;
-    return(0);
-  }
-
-  if (now-g->aim_lastnop >= 30) {
-    return(1);
-  }
-  return(0);
-}
-
-void owl_global_aimnop_sent(owl_global *g) {
-  time_t now;
-
-  now=time(NULL);
-  g->aim_lastnop=now;
+int owl_global_is_aimnop_time(owl_global *g)
+{
+  if (owl_timer_is_expired(&(g->aim_noop_timer))) return(1);
+  return(0);
+}
+
+void owl_global_aimnop_sent(owl_global *g)
+{
+  owl_timer_reset(&(g->aim_noop_timer));
+}
+
+owl_timer *owl_global_get_aim_login_timer(owl_global *g)
+{
+  return(&(g->aim_ignorelogin_timer));
 }
 
 /* message queue */
 
-void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m) {
+void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m)
+{
   owl_list_append_element(&(g->messagequeue), m);
 }
@@ -706,5 +707,6 @@
  * necessary.
  */
-owl_message *owl_global_messageuque_popmsg(owl_global *g) {
+owl_message *owl_global_messageuque_popmsg(owl_global *g)
+{
   owl_message *out;
 
@@ -715,10 +717,12 @@
 }
 
-int owl_global_messagequeue_pending(owl_global *g) {
+int owl_global_messagequeue_pending(owl_global *g)
+{
   if (owl_list_get_size(&(g->messagequeue))==0) return(0);
   return(1);
 }
 
-owl_buddylist *owl_global_get_buddylist(owl_global *g) {
+owl_buddylist *owl_global_get_buddylist(owl_global *g)
+{
   return(&(g->buddylist));
 }
Index: owl.h
===================================================================
--- owl.h	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ owl.h	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -358,4 +358,9 @@
 } owl_buddylist;
 
+typedef struct _owl_timer {
+  int direction;
+  time_t starttime;
+  int start;
+} owl_timer;
 
 typedef struct _owl_global {
@@ -408,5 +413,6 @@
   aim_session_t aimsess;
   aim_conn_t waitingconn;
-  time_t aim_lastnop;
+  owl_timer aim_noop_timer;
+  owl_timer aim_ignorelogin_timer;
   int aim_loggedin;
   char *aim_screenname;
Index: owl_prototypes.h
===================================================================
--- owl_prototypes.h	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ owl_prototypes.h	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -495,4 +495,5 @@
 extern int owl_global_is_aimnop_time(owl_global *g);
 extern void owl_global_aimnop_sent(owl_global *g);
+extern owl_timer *owl_global_get_aim_login_timer(owl_global *g);
 extern void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m);
 extern owl_message *owl_global_messageuque_popmsg(owl_global *g);
@@ -715,4 +716,12 @@
 extern int owl_text_num_lines(char *in);
 extern char *owl_text_htmlstrip(char *in);
+
+/* -------------------------------- timer.c -------------------------------- */
+extern void owl_timer_create_countup(owl_timer *t);
+extern void owl_timer_create_countdown(owl_timer *t, int start);
+extern void owl_timer_reset(owl_timer *t);
+extern void owl_timer_reset_newstart(owl_timer *t, int start);
+extern int owl_timer_get_time(owl_timer *t);
+extern int owl_timer_is_expired(owl_timer *t);
 
 /* -------------------------------- util.c -------------------------------- */
@@ -883,4 +892,6 @@
 extern void owl_global_set_edit_maxwrapcols(owl_global *g, int n);
 extern int owl_global_get_edit_maxwrapcols(owl_global *g);
+extern void owl_global_set_aim_ignorelogin_timer(owl_global *g, int n);
+extern int owl_global_get_aim_ignorelogin_timer(owl_global *g);
 extern void owl_global_set_typwin_lines(owl_global *g, int n);
 extern int owl_global_get_typwin_lines(owl_global *g);
Index: timer.c
===================================================================
--- timer.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
+++ timer.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -0,0 +1,74 @@
+#include "owl.h"
+
+#define OWL_TIMER_DIRECTION_COUNTUP    1
+#define OWL_TIMER_DIRECTION_COUNTDOWN  2
+
+
+/* Create a "counting up" timer.  The counter starts running as soon
+ * as this is called.  Use owl_timer_reset() to reset it.
+ */
+void owl_timer_create_countup(owl_timer *t)
+{
+  t->direction=OWL_TIMER_DIRECTION_COUNTUP;
+  t->starttime=time(NULL);
+}
+
+/* create a "counting down" timer, which counts down from 'start'
+ * seconds.  The counter starts running as soon as this is called.
+ * Use owl_timer_reset to reset it.
+ */
+void owl_timer_create_countdown(owl_timer *t, int start)
+{
+  t->direction=OWL_TIMER_DIRECTION_COUNTDOWN;
+  t->start=start;
+  t->starttime=time(NULL);
+}
+
+/* Reset the timer.  For a "counting up" timer, it is reset to 0.  For
+ * a "counting down" timer it is set to the value initially set with
+ * owl_timer_create_countdown() or the last value set with
+ * owl_timer_reset_newstart() */
+void owl_timer_reset(owl_timer *t)
+{
+  t->starttime=time(NULL);
+}
+
+/* Only for a countdown timer.  Rest the timer, but this time (and on
+ * future resets) start with 'start' seconds.
+ */
+void owl_timer_reset_newstart(owl_timer *t, int start)
+{
+  t->start=start;
+  t->starttime=time(NULL);
+}
+
+/* Return the number of seconds elapsed or remaining.  If using a
+ * countdown timer, a negative value is never reported.  Once the
+ * timer gets to 0 it stays at 0 */
+int owl_timer_get_time(owl_timer *t)
+{
+  time_t now;
+  int rem;
+
+  now=time(NULL);
+
+  if (t->direction==OWL_TIMER_DIRECTION_COUNTUP) {
+    return(now-t->starttime);
+  } else if (t->direction==OWL_TIMER_DIRECTION_COUNTDOWN) {
+    rem=t->start-(now-t->starttime);
+    if (rem<0) return(0);
+    return(rem);
+  }
+
+  /* never reached */
+  return(0);
+}
+
+/* Only for countdown timer.  Return true if time has run out (the
+ * timer is at 0 seconds or less
+ */
+int owl_timer_is_expired(owl_timer *t)
+{
+  if (owl_timer_get_time(t)==0) return(1);
+  return(0);
+}
Index: variable.c
===================================================================
--- variable.c	(revision ecd5dc5ca65a64da2e84de5dd1f997d246afd294)
+++ variable.c	(revision 6a415e91912b4795a141097f08a02c8a3229a908)
@@ -219,4 +219,13 @@
 		 "than 60 columns, as a courtesy to recipients.\n"),
 
+  OWLVAR_INT( "aim_ignorelogin_timer" /* %OwlVarStub */, 0,
+	      "number of seconds after AIM login to ignore login messages",
+	      "This specifies the number of seconds to wait after an\n"
+	      "AIM login before allowing the recipt of AIM login notifications.\n"
+	      "By default this is set to 0 and all login notifications are\n"
+	      "viewed immediately.  If you dislike this behavior try setting\n"
+	      "the value to 20 instead.\n"),
+
+	      
   OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */, 
 		   OWL_TYPWIN_SIZE,
