Kaynağa Gözat

* Removed USERENTRY_XTRA
* Removed note 'ignores', it was pointless.


svn: 618

Bryan Drewery 22 yıl önce
ebeveyn
işleme
0201da57c6
12 değiştirilmiş dosya ile 10 ekleme ve 540 silme
  1. 0 16
      misc/help.txt
  2. 0 3
      src/botcmd.c
  3. 1 5
      src/botmsg.c
  4. 0 1
      src/eggdrop.h
  5. 4 4
      src/mod/module.h
  6. 0 122
      src/mod/notes.mod/cmdsnote.c
  7. 0 170
      src/mod/notes.mod/notes.c
  8. 0 4
      src/mod/notes.mod/notes.h
  9. 4 15
      src/modules.c
  10. 0 2
      src/proto.h
  11. 0 196
      src/userent.c
  12. 1 2
      src/users.h

+ 0 - 16
misc/help.txt

@@ -49,11 +49,6 @@ See also: -ignore, ignores
    Invite time has to be expressed in days, hours, and/or minutes.
  
 See also: invites, -invite, stick, unstick
-::+noteign
-###  %b+noteign%b%{+m} [user]%{-} <ignoremask>
-   Add a new ignore to the user's note ignore list.
- 
-See also: -noteign noteigns
 ::+user
 ###  %b+user%b <handle> [hostmask]
    Creates a new user record for the handle given. The new user record will
@@ -120,11 +115,6 @@ See also: +ignore, ignores
    may also reference the invite by the number shown by the 'invites' command.
  
 See also: invites, +invite, stick, unstick
-::-noteign
-###  %b-noteign%b%{+m} [user]%{-} <ignoremask>
-   Remove an existing ignore from the user's note ignore list.
- 
-See also: +noteign noteigns
 ::-user
 ###  %b-user%b <handle>
    Removes the specified handle's user record.
@@ -1246,12 +1236,6 @@ See: handle
    the nickname.
  
 See also: whom, notes
-::noteigns
-###  %bnoteigns%b%{+m} [user]%{-}
-   List all note ignores. All notes sent from users who match one of the
-   ignore masks will be rejected.
- 
-See also: +noteign -noteign
 ::notes
 ###  %bnotes index%b
 ###  %bnotes read%b <# or ALL>

+ 0 - 3
src/botcmd.c

@@ -290,9 +290,6 @@ static void bot_priv(int idx, char *par)
 	case NOTE_FWD:
 	  botnet_send_priv(idx, botnetnick, from, NULL, "%s %s", "Not online; note forwarded to:", to);
 	  break;
-	case NOTE_REJECT:
-	  botnet_send_priv(idx, botnetnick, from, NULL, "%s %s", to, "rejected your note.");
-          break;
 	case NOTE_TCL:
 	  break;		/* Do nothing */
 	case NOTE_OK:

+ 1 - 5
src/botmsg.c

@@ -621,11 +621,7 @@ int add_note(char *to, char *from, char *msg, int idx, int echo)
       dprintf(idx, BOT_NONOTES);
     return NOTE_ERROR;
   }
-  if (match_noterej(u, from)) {
-    if (idx >= 0)
-       dprintf(idx, "%s %s\n", u->handle, "rejected your note.");
-    return NOTE_REJECT;
-  }
+
   status = NOTE_STORED;
   iaway = 0;
   /* Online right now? */

+ 0 - 1
src/eggdrop.h

@@ -698,7 +698,6 @@ enum {
 #define NOTE_TCL        4	/* tcl binding caught it	*/
 #define NOTE_AWAY       5	/* away; stored			*/
 #define NOTE_FWD        6	/* away; forwarded		*/
-#define NOTE_REJECT     7	/* ignore mask matched		*/
 
 #define STR_PROTECT     2
 #define STR_DIR         1

+ 4 - 4
src/mod/module.h

@@ -276,8 +276,8 @@
 #define delignore ((int (*)(char *))global[142])
 #define fatal (global[143])
 /* 144 - 147 */
-#define xtra_kill ((void (*)(struct user_entry *))global[144])
-#define xtra_unpack ((void (*)(struct userrec *, struct user_entry *))global[145])
+/* UNUSED 144 */
+/* UNUSED 145 */
 #define movefile ((int (*) (char *, char *))global[146])
 #define copyfile ((int (*) (char *, char *))global[147])
 /* 148 - 151 */
@@ -336,7 +336,7 @@
 #define USERENTRY_HOSTS (*(struct user_entry_type *)(global[190]))
 #define USERENTRY_PASS (*(struct user_entry_type *)(global[191]))
 /* 192 - 195 */
-#define USERENTRY_XTRA (*(struct user_entry_type *)(global[192]))
+/* UNUSED 192 */
 #define user_del_chan ((void(*)(char *))(global[193]))
 #define USERENTRY_INFO (*(struct user_entry_type *)(global[194]))
 #define USERENTRY_COMMENT (*(struct user_entry_type *)(global[195]))
@@ -384,7 +384,7 @@
 /* 228 */
 /* UNUSED 229 */
 /* UNUSED 230 */
-#define xtra_set ((int(*)(struct userrec *,struct user_entry *, void *))global[231])
+/* UNUSED 231 */
 /* 232 - 235 */
 #ifdef DEBUG_CONTEXT
 #  define ContextNote(note) (global[232](__FILE__, __LINE__, MODULE_NAME, note))

+ 0 - 122
src/mod/notes.mod/cmdsnote.c

@@ -4,125 +4,6 @@
  *
  */
 
-static void cmd_pls_noteign(struct userrec *u, int idx, char *par)
-{
-  struct userrec *u2;
-  char *handle, *mask, *buf, *p;
-  if (!par[0]) {
-    dprintf(idx, "%s: +noteign [handle] <ignoremask>\n", NOTES_USAGE);
-    return;
-  }
-  putlog(LOG_CMDS, "*", "#%s# +noteign %s", dcc[idx].nick, par);
-
-  p = buf = strdup(par);
-  handle = newsplit(&p);
-  mask = newsplit(&p);
-  if (mask[0]) {
-    u2 = get_user_by_handle(userlist, handle);
-    if (u != u2) {
-      struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-      get_user_flagrec(u, &fr, dcc[idx].u.chat->con_chan);
-      if (!(glob_master(fr) || glob_owner(fr))) {
-	dprintf(idx, NOTES_IGN_OTHERS, handle);
-	free(buf);
-        return;
-      }
-    }
-    if (!u2) {
-      dprintf(idx, NOTES_UNKNOWN_USER, handle);
-      free(buf);
-      return;
-    }
-  } else {
-    u2 = u;
-    mask = handle;
-  }
-  if (add_note_ignore(u2, mask))
-    dprintf(idx, NOTES_IGN_NEW, mask);
-  else
-    dprintf(idx, NOTES_IGN_ALREADY, mask);
-  free(buf);
-  return;
-}
-
-static void cmd_mns_noteign(struct userrec *u, int idx, char *par)
-{
-  struct userrec *u2;
-  char *handle, *mask, *buf, *p;
-  if (!par[0]) {
-    dprintf(idx, "%s: -noteign [handle] <ignoremask>\n", NOTES_USAGE);
-    return;
-  }
-  putlog(LOG_CMDS, "*", "#%s# -noteign %s", dcc[idx].nick, par);
-  p = buf = strdup(par);
-  handle = newsplit(&p);
-  mask = newsplit(&p);
-  if (mask[0]) {
-    u2 = get_user_by_handle(userlist, handle);
-    if (u != u2) {
-      struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-      get_user_flagrec(u, &fr, dcc[idx].u.chat->con_chan);
-      if (!(glob_master(fr) || glob_owner(fr))) {
-	dprintf(idx, NOTES_IGN_OTHERS, handle);
-	free(buf);
-        return;
-      }
-    }
-    if (!u2) {
-      dprintf(idx, NOTES_UNKNOWN_USER, handle);
-      free(buf);
-      return;
-    }
-  } else {
-    u2 = u;
-    mask = handle;
-  }
-
-  if (del_note_ignore(u2, mask))
-    dprintf(idx, NOTES_IGN_REM, mask);
-  else
-    dprintf(idx, NOTES_IGN_NOTFOUND, mask);
-  free(buf);
-  return;
-}
-
-static void cmd_noteigns(struct userrec *u, int idx, char *par)
-{
-  struct userrec *u2;
-  char **ignores;
-  int ignoresn, i;
-
-  if (par[0]) {
-    u2 = get_user_by_handle(userlist, par);
-    if (u != u2) {
-      struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-      get_user_flagrec(u, &fr, dcc[idx].u.chat->con_chan);
-      if (!(glob_master(fr) || glob_owner(fr))) {
-	dprintf(idx, NOTES_IGN_OTHERS, par);
-        return;
-      }
-    }
-    if (!u2) {
-      dprintf(idx, NOTES_UNKNOWN_USER, par);
-      return;
-    }
-  } else
-    u2 = u;
-
-  ignoresn = get_note_ignores(u2, &ignores);
-  if (!ignoresn) {
-    dprintf(idx, "%s", NOTES_IGN_NONE);
-    return;
-  }
-  putlog(LOG_CMDS, "*", "#%s# noteigns %s", dcc[idx].nick, par);
-  dprintf(idx, NOTES_IGN_FOR, u2->handle);
-  for (i = 0; i < ignoresn; i++)
-    dprintf(idx, " %s", ignores[i]);
-  dprintf(idx, "\n");
-  free(ignores[0]);		/* Free the string buffer	*/
-  free(ignores);		/* Free the ptr array		*/
-}
-
 static void cmd_fwd(struct userrec *u, int idx, char *par)
 {
   char *handle;
@@ -218,9 +99,6 @@ static cmd_t notes_cmds[] =
 {
   {"fwd",	"m",	(Function) cmd_fwd,		NULL},
   {"notes",	"",	(Function) cmd_notes,		NULL},
-  {"+noteign",	"",	(Function) cmd_pls_noteign,	NULL},
-  {"-noteign",	"",	(Function) cmd_mns_noteign,	NULL},
-  {"noteigns",	"",	(Function) cmd_noteigns,	NULL},
   {"note",	"",	(Function) cmd_note,		NULL},
   {NULL,	NULL,	NULL,				NULL}
 };

+ 0 - 170
src/mod/notes.mod/notes.c

@@ -711,175 +711,6 @@ static int chon_notes(char *nick, int idx)
   return 0;
 }
 
-/* Return either NULL or a pointer to the xtra_key structure
- * where the not ignores are kept.
- */
-static struct xtra_key *getnotesentry(struct userrec *u)
-{
-  struct user_entry *ue = find_user_entry(&USERENTRY_XTRA, u);
-  struct xtra_key *xk, *nxk = NULL;
-
-  if (!ue)
-    return NULL;
-  /* Search for the notes ignore list entry */
-  for (xk = ue->u.extra; xk; xk = xk->next)
-    if (xk->key && !egg_strcasecmp(xk->key, NOTES_IGNKEY)) {
-      nxk = xk;
-      break;
-    }
-  if (!nxk || !nxk->data || !(nxk->data[0]))
-    return NULL;
-  return nxk;
-}
-
-/* Parse the NOTES_IGNKEY xtra field. You must free the memory allocated
- * in here: the buffer 'ignores[0]' and the array 'ignores'.
- */
-int get_note_ignores(struct userrec *u, char ***ignores)
-{
-  struct xtra_key *xk;
-  char *buf, *p;
-  int ignoresn;
-
-  /* Hullo? sanity? */
-  if (!u)
-    return 0;
-  xk = getnotesentry(u);
-  if (!xk)
-    return 0;
-
-  rmspace(xk->data);
-  buf = strdup(xk->data);
-  p = buf;
-
-  /* Split up the string into small parts */
-  *ignores = malloc(sizeof(char *) + 100);
-  **ignores = p;
-  ignoresn = 1;
-  while ((p = strchr(p, ' ')) != NULL) {
-    *ignores = realloc(*ignores, sizeof(char *) * (ignoresn+1));
-    (*ignores)[ignoresn] = p + 1;
-    ignoresn++;
-    *p = 0;
-    p++;
-  }
-  return ignoresn;
-}
-
-int add_note_ignore(struct userrec *u, char *mask)
-{
-  struct xtra_key *xk;
-  char **ignores;
-  int ignoresn, i;
-
-  ignoresn = get_note_ignores(u, &ignores);
-  if (ignoresn > 0) {
-    /* Search for existing mask */
-    for (i = 0; i < ignoresn; i++)
-      if (!strcmp(ignores[i], mask)) {
-        free(ignores[0]);	/* Free the string buffer	*/
-        free(ignores);		/* Free the ptr array		*/
-	/* The mask already exists, exit. */
-        return 0;
-      }
-    free(ignores[0]);		/* Free the string buffer	*/
-    free(ignores);		/* Free the ptr array		*/
-  }
-
-  xk = getnotesentry(u);
-  /* First entry? */
-  if (!xk) {
-    struct xtra_key *mxk = malloc(sizeof(struct xtra_key));
-    struct user_entry *ue = find_user_entry(&USERENTRY_XTRA, u);
-
-    if (!ue)
-      return 0;
-    mxk->next = 0;
-    mxk->data = strdup(mask);
-    mxk->key = strdup(NOTES_IGNKEY);
-    xtra_set(u, ue, mxk);
-  } else { /* ... else, we already have other entries. */
-    xk->data = realloc(xk->data, strlen(xk->data) + strlen(mask) + 2);
-    strcat(xk->data, " ");
-    strcat(xk->data, mask);
-  }
-  return 1;
-}
-
-int del_note_ignore(struct userrec *u, char *mask)
-{
-  struct user_entry *ue;
-  struct xtra_key *xk;
-  char **ignores, *buf = NULL;
-  int ignoresn, i, size = 0, foundit = 0;
-
-  ignoresn = get_note_ignores(u, &ignores);
-  if (!ignoresn)
-    return 0;
-
-  buf = malloc(1);
-  buf[0] = 0;
-  for (i = 0; i < ignoresn; i++) {
-    if (strcmp(ignores[i], mask)) {
-      size += strlen(ignores[i]);
-      if (buf[0])
-	size++;
-      buf = realloc(buf, size+1);
-      if (buf[0])
-	strcat(buf, " ");
-      strcat(buf, ignores[i]);
-    } else
-      foundit = 1;
-  }
-  free(ignores[0]);		/* Free the string buffer	*/
-  free(ignores);		/* Free the ptr array		*/
-  /* Entry not found */
-  if (!foundit) {
-    free(buf);
-    return 0;
-  }
-  ue = find_user_entry(&USERENTRY_XTRA, u);
-  /* Delete the entry if the buffer is empty */
-
-  xk = malloc(sizeof(struct xtra_key));
-  xk->key = malloc(strlen(NOTES_IGNKEY)+1);
-  xk->next = 0;
-
-  if (!buf[0]) {
-    free(buf); /* The allocated byte needs to be free'd too */
-    strcpy(xk->key, NOTES_IGNKEY);
-    xk->data = 0;
-  } else {
-    xk->data = buf;
-    strcpy(xk->key, NOTES_IGNKEY);
-  }
-  xtra_set(u, ue, xk);
-  return 1;
-}
-
-/* Returns 1 if the user u has an note ignore which
- * matches from
- */
-int match_note_ignore(struct userrec *u, char *from)
-{
-  char **ignores;
-  int ignoresn, i;
-
-  ignoresn = get_note_ignores(u, &ignores);
-  if (!ignoresn)
-    return 0;
-  for (i = 0; i < ignoresn; i++)
-    if (wild_match(ignores[i], from)) {
-      free(ignores[0]);
-      free(ignores);
-      return 1;
-    }
-  free(ignores[0]);		/* Free the string buffer	*/
-  free(ignores);		/* Free the ptr array		*/
-  return 0;
-}
-
-
 static cmd_t notes_nkch[] =
 {
   {"*",		"",	(Function) notes_change,	"notes"},
@@ -946,7 +777,6 @@ char *notes_start(Function * global_funcs)
   notefile[0] = 0;
   module_register(MODULE_NAME, notes_table, 2, 1);
   add_hook(HOOK_HOURLY, (Function) notes_hourly);
-  add_hook(HOOK_MATCH_NOTEREJ, (Function) match_note_ignore);
   add_hook(HOOK_STORENOTE, (Function) storenote);
 
   add_builtins("dcc", notes_cmds);

+ 0 - 4
src/mod/notes.mod/notes.h

@@ -57,10 +57,6 @@
 #define NOTES_MUSTBE			"Function must be one of INDEX, READ, or ERASE."
 
 #ifdef MAKING_NOTES
-static int get_note_ignores(struct userrec *, char ***);
-static int add_note_ignore(struct userrec *, char *);
-static int del_note_ignore(struct userrec *, char *);
-static int match_note_ignore(struct userrec *, char *);
 static void notes_read(char *, char *, char *, int);
 static void notes_del(char *, char *, char *, int);
 static void fwd_display(int, struct user_entry *, struct userrec *);

+ 4 - 15
src/modules.c

@@ -49,8 +49,6 @@ extern sock_list        *socklist;
 #ifdef S_MSGCMDS
 extern struct cfg_entry CFG_MSGOP, CFG_MSGPASS, CFG_MSGINVITE, CFG_MSGIDENT;
 #endif /* S_MSGCMDS */
-int xtra_kill();
-int xtra_unpack();
 static int module_rename(char *name, char *newname);
 
 
@@ -131,7 +129,6 @@ void (*sharein) (int, char *) = null_share;
 void (*shareupdatein) (int, char *) = null_share;
 void (*qserver) (int, char *, int) = (void (*)(int, char *, int)) null_func;
 void (*add_mode) () = null_func;
-int (*match_noterej) (struct userrec *, char *) = (int (*)(struct userrec *, char *)) false_func;
 int (*storenote)(char *from, char *to, char *msg, int idx, char *who, int bufsize) = (int (*)(char *from, char *to, char *msg, int idx, char *who, int bufsize)) minus_func;
 int (*rfc_casecmp) (const char *, const char *) = _rfc_casecmp;
 int (*rfc_ncasecmp) (const char *, const char *, int) = _rfc_ncasecmp;
@@ -336,8 +333,8 @@ Function global_table[] =
   (Function) delignore,
   (Function) fatal,
   /* 144 - 147 */
-  (Function) xtra_kill, 
-  (Function) xtra_unpack,
+  (Function) 0, 
+  (Function) 0,
   (Function) movefile,
   (Function) copyfile,
   /* 148 - 151 */
@@ -396,7 +393,7 @@ Function global_table[] =
   (Function) & USERENTRY_HOSTS,		/* struct user_entry_type *	*/
   (Function) & USERENTRY_PASS,		/* struct user_entry_type *	*/
   /* 192 - 195 */
-  (Function) & USERENTRY_XTRA,		/* struct user_entry_type *	*/
+  (Function) 0,
   (Function) user_del_chan,
   (Function) & USERENTRY_INFO,		/* struct user_entry_type *	*/
   (Function) & USERENTRY_COMMENT,	/* struct user_entry_type *	*/
@@ -444,7 +441,7 @@ Function global_table[] =
   (Function) 0,
   (Function) 0,
   (Function) 0,
-  (Function) xtra_set, 
+  (Function) 0, 
   /* 232 - 235 */
 #ifdef DEBUG_CONTEXT
   (Function) eggContextNote,
@@ -810,10 +807,6 @@ void add_hook(int hook_num, Function func)
 	rfc_toupper = _rfc_toupper;
       }
       break;
-    case HOOK_MATCH_NOTEREJ:
-      if (match_noterej == (int (*)(struct userrec *, char *))false_func)
-	match_noterej = func;
-      break;
     case HOOK_STORENOTE:
 	if (func == NULL) storenote = (int (*)(char *from, char *to, char *msg, int idx, char *who, int bufsize)) minus_func;
 	else storenote = func;
@@ -868,10 +861,6 @@ void del_hook(int hook_num, Function func)
       if (add_mode == (void (*)()) func)
 	add_mode = null_func;
       break;
-    case HOOK_MATCH_NOTEREJ:
-      if (match_noterej == (int (*)(struct userrec *, char *))func)
-	match_noterej = false_func;
-      break;
     case HOOK_STORENOTE:
 	if (storenote == func) storenote = (int (*)(char *from, char *to, char *msg, int idx, char *who, int bufsize)) minus_func;
 	break;

+ 0 - 2
src/proto.h

@@ -34,7 +34,6 @@ extern int (*rfc_casecmp) (const char *, const char *);
 extern int (*rfc_ncasecmp) (const char *, const char *, int);
 extern int (*rfc_toupper) (int);
 extern int (*rfc_tolower) (int);
-extern int (*match_noterej) (struct userrec *, char *);
 extern int (*storenote)(char *from, char *to, char *msg, int idx, char *who, int bufsize);
 #endif /* !MAKING_MODS */
 
@@ -342,7 +341,6 @@ int flush_inbuf(int idx);
 /* userent.c */
 void update_mod(char *, char *, char *, char *);
 void list_type_kill(struct list_type *);
-int xtra_set();
 void stats_add(struct userrec *, int, int);
 
 

+ 0 - 196
src/userent.c

@@ -22,7 +22,6 @@ void init_userent()
 {
   entry_type_list = 0;
   add_entry_type(&USERENTRY_COMMENT);
-  add_entry_type(&USERENTRY_XTRA);
   add_entry_type(&USERENTRY_INFO);
   add_entry_type(&USERENTRY_LASTON);
   add_entry_type(&USERENTRY_BOTADDR);
@@ -910,201 +909,6 @@ struct user_entry_type USERENTRY_BOTADDR =
   botaddr_display,
   "BOTADDR"
 };
-int xtra_set(struct userrec *u, struct user_entry *e, void *buf)
-{
-  struct xtra_key *curr, *old = NULL, *new = buf;
-
-  for (curr = e->u.extra; curr; curr = curr->next) {
-    if (curr->key && !egg_strcasecmp(curr->key, new->key)) {
-      old = curr;
-      break;
-    }
-  }
-  if (!old && (!new->data || !new->data[0])) {
-    /* Delete non-existant entry -- doh ++rtc */
-    free(new->key);
-    if (new->data)
-      free(new->data);
-    free(new);
-    return TCL_OK;
-  }
-
-  /* We will possibly free new below, so let's send the information
-   * to the botnet now
-   */
-  if (!noshare && !(u->flags & (USER_BOT | USER_UNSHARED)))
-    shareout(NULL, "c XTRA %s %s %s\n", u->handle, new->key,
-             new->data ? new->data : "");
-  if ((old && old != new) || !new->data || !new->data[0]) {
-    list_delete((struct list_type **) (&e->u.extra),
-                (struct list_type *) old);
-    free(old->key);
-    free(old->data);
-    free(old);
-  }
-  if (old != new && new->data) {
-    if (new->data[0])
-      list_insert((&e->u.extra), new) /* do not add a ';' here */
-  } else {
-    if (new->data)
-      free(new->data);
-    free(new->key);
-    free(new);
-  }
-  return TCL_OK;
-}
-
-int xtra_unpack(struct userrec *u, struct user_entry *e)
-{
-  struct list_type *curr, *head;
-  struct xtra_key *t;
-  char *key, *data;
-
-  head = curr = e->u.list;
-  e->u.extra = NULL;
-  while (curr) {
-    t = malloc(sizeof(struct xtra_key));
-
-    data = curr->extra;
-    key = newsplit(&data);
-    if (data[0]) {
-      t->key = strdup(key);
-      t->data = strdup(data);
-      list_insert((&e->u.extra), t);
-    }
-    curr = curr->next;
-  }
-  list_type_kill(head);
-  return 1;
-}
-
-static int xtra_pack(struct userrec *u, struct user_entry *e)
-{
-  struct list_type *t;
-  struct xtra_key *curr, *next;
-
-  curr = e->u.extra;
-  e->u.list = NULL;
-  while (curr) {
-    t = malloc(sizeof(struct list_type));
-    t->extra = malloc(strlen(curr->key) + strlen(curr->data) + 4);
-    sprintf(t->extra, "%s %s", curr->key, curr->data);
-    list_insert((&e->u.list), t);
-    next = curr->next;
-    free(curr->key);
-    free(curr->data);
-    free(curr);
-    curr = next;
-  }
-  return 1;
-}
-
-static void xtra_display(int idx, struct user_entry *e, struct userrec *u)
-{
-  int code, lc, j;
-  struct xtra_key *xk;
-#if ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))
-  CONST char **list;
-#else
-  char **list;
-#endif
-  code = Tcl_SplitList(interp, whois_fields, &lc, &list);
-  if (code == TCL_ERROR)
-    return;
-  /* Scan thru xtra field, searching for matches */
-  for (xk = e->u.extra; xk; xk = xk->next) {
-    /* Ok, it's a valid xtra field entry */
-    for (j = 0; j < lc; j++) {
-      if (!egg_strcasecmp(list[j], xk->key))
-        dprintf(idx, "  %s: %s\n", xk->key, xk->data);
-    }
-  }
-  Tcl_Free((char *) list);
-}
-
-static int xtra_gotshare(struct userrec *u, struct user_entry *e,
-                         char *buf, int idx)
-{
-  char *arg;
-  struct xtra_key *xk;
-  int l;
-  arg = newsplit (&buf);
-  if (!arg[0])
-    return 1;
-
-  xk = malloc (sizeof(struct xtra_key));
-  egg_bzero(xk, sizeof(struct xtra_key));
-  l = strlen(arg);
-  if (l > 500)
-    l = 500;
-  xk->key = malloc(l + 1);
-  strncpyz(xk->key, arg, l + 1);
-
-  if (buf[0]) {
-    int k = strlen(buf);
-
-    if (k > 500 - l)
-      k = 500 - l;
-    xk->data = malloc(k + 1);
-    strncpyz(xk->data, buf, k + 1);
-  }
-  xtra_set(u, e, xk);
-  return 1;
-}
-
-static int xtra_dupuser(struct userrec *new, struct userrec *old,
-                        struct user_entry *e)
-{
-  struct xtra_key *x1, *x2;
-
-  for (x1 = e->u.extra; x1; x1 = x1->next) {
-    x2 = malloc(sizeof(struct xtra_key));
-
-    x2->key = strdup(x1->key);
-    x2->data = strdup(x1->data);
-    set_user(&USERENTRY_XTRA, new, x2);
-  }
-  return 1;
-}
-static int xtra_write_userfile(FILE *f, struct userrec *u, struct user_entry *e)
-{
-  struct xtra_key *x;
-
-  for (x = e->u.extra; x; x = x->next)
-    if (lfprintf(f, "--XTRA %s %s\n", x->key, x->data) == EOF)
-      return 0;
-  return 1;
-}
-
-int xtra_kill(struct user_entry *e)
-{
-  struct xtra_key *x, *y;
-
-  for (x = e->u.extra; x; x = y) {
-    y = x->next;
-    free(x->key);
-    free(x->data);
-    free(x);
-  }
-  free(e);
-  return 1;
-}
-
-struct user_entry_type USERENTRY_XTRA =
-{
-  0,
-  xtra_gotshare,
-  xtra_dupuser,
-  xtra_unpack,
-  xtra_pack,
-  xtra_write_userfile,
-  xtra_kill,
-  def_get,
-  xtra_set,
-  xtra_display,
-  "XTRA"
-};
-
 
 static int hosts_dupuser(struct userrec *new, struct userrec *old,
 			 struct user_entry *e)

+ 1 - 2
src/users.h

@@ -50,8 +50,7 @@ extern struct user_entry_type USERENTRY_COMMENT, USERENTRY_LASTON,
   USERENTRY_ADDED,
   USERENTRY_MODIFIED,
   USERENTRY_CONFIG,
-  USERENTRY_SECPASS,
-  USERENTRY_XTRA;
+  USERENTRY_SECPASS;
 #endif /* MAKING_MODS */