Index: src/dcc.c
===================================================================
RCS file: /usr/local/cvsroot/Sentinel/src/dcc.c,v
retrieving revision 1.125
retrieving revision 1.127
diff -u -r1.125 -r1.127
--- src/dcc.c	12 Sep 2003 14:29:29 -0000	1.125
+++ src/dcc.c	27 Sep 2003 13:10:49 -0000	1.127
@@ -659,6 +659,7 @@
   struct Channel *c;
   struct User *u;
   struct ChanUser *cu;
+  int adminopped = FALSE;
   int member = FALSE; /* Is AdminServ already in the channel? */
 
   if (conn->myuser == NULL || !IsSetOperOp(conn->myuser))
@@ -689,7 +690,14 @@
 
   cu = findchanuser(c, AdminServ.u);
   if (cu != NULL)
+  {
     member = TRUE;
+    if (cu->modes & CMODE_OP)
+      adminopped = TRUE;
+    else
+      /* adminopped defaults to FALSE, we need to make it an op */
+      cu->modes |= CMODE_OP;
+  }
 
   cu = findchanuser(c, u);
   if (cu == NULL)
@@ -699,7 +707,12 @@
     return 0;
   }
 
-  if (member == FALSE)
+  if ((member == TRUE) && (adminopped == FALSE))
+  {
+    sts(":%s PART %s :Preparing to .op", AdminServ.nick, c->name);
+  }
+
+  if ((member == FALSE) || ((member == TRUE) && (adminopped == FALSE)))
   {
     /* The logic here is to SJOIN into the channel with ops, set
     ** the user to opped, then part.  This logic is chosed as it's

