~ubuntu-branches/ubuntu/oneiric/eggdrop/oneiric

« back to all changes in this revision

Viewing changes to src/mod/seen.mod/seen.c

  • Committer: Bazaar Package Importer
  • Author(s): Guilherme de S. Pastore
  • Date: 2004-06-17 09:15:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040617091528-64rrw1sa33lkfhmh
Tags: 1.6.16-2
* Fixed typo on README.Debian
* Fixed hyphens in manual page
* Converted debian/rules to CDBS
* Set path to binary on example config file
* Changed LANGDIR on src/eggdrop.h (Closes: #254824)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * 1.2     1997-08-20      Minor fixes. [BB]
11
11
 * 1.2a    1997-08-24      Minor fixes. [BB]
12
12
 *
13
 
 * $Id: seen.c,v 1.24 2002/01/02 03:46:39 guppy Exp $
 
13
 * $Id: seen.c,v 1.33 2004/01/09 05:56:38 wcc Exp $
14
14
 */
15
15
/*
16
 
 * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
 
16
 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
17
17
 *
18
18
 * This program is free software; you can redistribute it and/or
19
19
 * modify it under the terms of the GNU General Public License
73
73
#define MODULE_NAME "seen"
74
74
#define MAKING_SEEN
75
75
 
76
 
#include <time.h>
 
76
#ifdef HAVE_CONFIG_H
 
77
# include "config.h"
 
78
#endif
 
79
 
 
80
#ifdef TIME_WITH_SYS_TIME
 
81
# include <sys/time.h>
 
82
# include <time.h>
 
83
#else
 
84
# ifdef HAVE_SYS_TIME_H
 
85
#  include <sys/time.h>
 
86
# else
 
87
#  include <time.h>
 
88
# endif
 
89
#endif
77
90
 
78
91
#include "src/mod/module.h"
79
92
#include "src/users.h"
92
105
  char *text;
93
106
} trig_data;
94
107
 
95
 
static trig_data trigdata[] =
96
 
{
97
 
  {"god",       "Let's not get into a religious discussion, %s"},
98
 
  {"jesus",     "Let's not get into a religious discussion, %s"},
99
 
  {"shit",      "Here's looking at you, %s"},
100
 
  {"yourself",  "Yeah, whenever I look in a mirror..."},
101
 
  {NULL,        "You found me, %s!"},
102
 
  {"elvis",     "Last time I was on the moon man."},
103
 
  {NULL,        NULL}
 
108
static trig_data trigdata[] = {
 
109
  {"god",      "Let's not get into a religious discussion, %s"},
 
110
  {"jesus",    "Let's not get into a religious discussion, %s"},
 
111
  {"shit",                         "Here's looking at you, %s"},
 
112
  {"yourself",          "Yeah, whenever I look in a mirror..."},
 
113
  {NULL, "                                  You found me, %s!"},
 
114
  {"elvis",                 "Last time I was on the moon man."},
 
115
  {NULL,                                                  NULL}
104
116
};
105
117
 
106
118
static int seen_expmem()
107
119
{
108
 
  int size = 0;
109
 
 
110
 
  return size;
 
120
  return 0;
111
121
}
112
122
 
113
123
/* PUB `seen' trigger. */
114
124
static int pub_seen(char *nick, char *host, char *hand,
115
 
                    char *channel, char *text)
 
125
                    char *channel, char *text)
116
126
{
117
 
  char prefix[50];
 
127
  char prefix[91];              /* sizeof(name) + strlen("PRIVMSG  :") */
118
128
  struct chanset_t *chan = findchan_by_dname(channel);
119
129
 
120
130
  if ((chan != NULL) && channel_seen(chan)) {
121
 
    sprintf(prefix, "PRIVMSG %s :", chan->name);
 
131
    egg_snprintf(prefix, sizeof prefix, "PRIVMSG %s :", chan->name);
122
132
    do_seen(DP_HELP, prefix, nick, hand, chan->dname, text);
123
133
  }
124
134
  return 0;
146
156
}
147
157
 
148
158
static void do_seen(int idx, char *prefix, char *nick, char *hand,
149
 
                    char *channel, char *text)
 
159
                    char *channel, char *text)
150
160
{
151
161
  char stuff[512];
152
162
  char word1[512], word2[512];
171
181
  /* Was ANYONE specified */
172
182
  if (!text[0]) {
173
183
    dprintf(idx, "%sUm, %s, it might help if you ask me about _someone_...\n",
174
 
            prefix, nick);
 
184
            prefix, nick);
175
185
    return;
176
186
  }
177
187
  wordshift(word1, text);
178
188
  oix = strchr(word1, '\'');
179
189
  /* Have we got a NICK's target? */
180
190
  if (oix == word1)
181
 
    return;                     /* Skip anything starting with ' */
182
 
  if (oix && *oix &&
183
 
      ((oix[1] && (oix[1] == 's' || oix[1] == 'S') && !oix[2]) ||
184
 
       (!oix[1] &&
185
 
        (oix[-1] == 's' || oix[-1] == 'z' || oix[-1] == 'x' ||
186
 
         oix[-1] == 'S' || oix[-1] == 'Z' || oix[-1] == 'X')))) {
 
191
    return;                     /* Skip anything starting with ' */
 
192
  if (oix && *oix && ((oix[1] && (oix[1] == 's' || oix[1] == 'S') &&
 
193
      !oix[2]) || (!oix[1] && (oix[-1] == 's' || oix[-1] == 'z' ||
 
194
      oix[-1] == 'x' || oix[-1] == 'S' || oix[-1] == 'Z' ||
 
195
      oix[-1] == 'X')))) {
187
196
    strncpy(object, word1, oix - word1);
188
197
    object[oix - word1] = 0;
189
198
    wordshift(word1, text);
195
204
    if (!urec) {
196
205
      chan = chanset;
197
206
      while (chan) {
198
 
        onchan = 0;
199
 
        m = ismember(chan, object);
200
 
        if (m) {
201
 
          onchan = 1;
202
 
          sprintf(stuff, "%s!%s", object, m->userhost);
203
 
          urec = get_user_by_host(stuff);
204
 
          if (!urec || !egg_strcasecmp(object, urec->handle))
205
 
            break;
206
 
          strcat(whoredirect, object);
207
 
          strcat(whoredirect, " is ");
208
 
          strcat(whoredirect, urec->handle);
209
 
          strcat(whoredirect, ", and ");
210
 
          strcpy(object, urec->handle);
211
 
          break;
212
 
        }
213
 
        chan = chan->next;
 
207
        onchan = 0;
 
208
        m = ismember(chan, object);
 
209
        if (m) {
 
210
          onchan = 1;
 
211
          sprintf(stuff, "%s!%s", object, m->userhost);
 
212
          urec = get_user_by_host(stuff);
 
213
          if (!urec || !egg_strcasecmp(object, urec->handle))
 
214
            break;
 
215
          strcat(whoredirect, object);
 
216
          strcat(whoredirect, " is ");
 
217
          strcat(whoredirect, urec->handle);
 
218
          strcat(whoredirect, ", and ");
 
219
          strcpy(object, urec->handle);
 
220
          break;
 
221
        }
 
222
        chan = chan->next;
214
223
      }
215
224
      if (!onchan) {
216
 
        dprintf(idx, "%sI don't think I know who %s is, %s.\n",
217
 
                prefix, object, nick);
218
 
        return;
 
225
        dprintf(idx, "%sI don't think I know who %s is, %s.\n",
 
226
                prefix, object, nick);
 
227
        return;
219
228
      }
220
229
    }
221
230
    if (!egg_strcasecmp(word1, "bf") || !egg_strcasecmp(word1, "boyfriend")) {
222
231
      strcpy(whotarget, getxtra(object, "BF"));
223
232
      if (whotarget[0]) {
224
 
        sprintf(whoredirect, "%s boyfriend is %s, and ",
225
 
                fixnick(object), whotarget);
226
 
        goto targetcont;
 
233
        sprintf(whoredirect, "%s boyfriend is %s, and ",
 
234
                fixnick(object), whotarget);
 
235
        goto targetcont;
227
236
      }
228
237
      dprintf(idx,
229
 
              "%sI don't know who %s boyfriend is, %s.\n",
230
 
              prefix, fixnick(object), nick);
 
238
              "%sI don't know who %s boyfriend is, %s.\n",
 
239
              prefix, fixnick(object), nick);
231
240
      return;
232
241
    }
233
242
    if (!egg_strcasecmp(word1, "gf") || !egg_strcasecmp(word1, "girlfriend")) {
234
243
      strcpy(whotarget, getxtra(object, "GF"));
235
244
      if (whotarget[0]) {
236
 
        sprintf(whoredirect, "%s girlfriend is %s, and ",
237
 
                fixnick(object), whotarget);
238
 
        goto targetcont;
 
245
        sprintf(whoredirect, "%s girlfriend is %s, and ",
 
246
                fixnick(object), whotarget);
 
247
        goto targetcont;
239
248
      }
240
249
      dprintf(idx,
241
 
              "%sI don't know who %s girlfriend is, %s.\n",
242
 
              prefix, fixnick(object), nick);
 
250
              "%sI don't know who %s girlfriend is, %s.\n",
 
251
              prefix, fixnick(object), nick);
243
252
      return;
244
253
    }
245
254
    dprintf(idx,
246
 
          "%sWhy are you bothering me with questions about %s %s, %s?\n",
247
 
            prefix, fixnick(object), word1, nick);
 
255
            "%sWhy are you bothering me with questions about %s %s, %s?\n",
 
256
            prefix, fixnick(object), word1, nick);
248
257
    return;
249
258
  }
250
259
  /* Keyword "my" */
257
266
    /* Do I even KNOW the requestor? */
258
267
    if (hand[0] == '*' || !hand[0]) {
259
268
      dprintf(idx,
260
 
              "%sI don't know you, %s, so I don't know about your %s.\n",
261
 
              prefix, nick, word1);
 
269
              "%sI don't know you, %s, so I don't know about your %s.\n",
 
270
              prefix, nick, word1);
262
271
      return;
263
272
    }
264
273
    /* "my boyfriend" */
265
274
    if (!egg_strcasecmp(word1, "boyfriend") || !egg_strcasecmp(word1, "bf")) {
266
275
      strcpy(whotarget, getxtra(hand, "BF"));
267
276
      if (whotarget[0]) {
268
 
        sprintf(whoredirect, "%s, your boyfriend is %s, and ",
269
 
                nick, whotarget);
 
277
        sprintf(whoredirect, "%s, your boyfriend is %s, and ", nick, whotarget);
270
278
      } else {
271
 
        dprintf(idx,
272
 
                "%sI didn't know you had a boyfriend, %s\n",
273
 
                prefix, nick);
274
 
        return;
 
279
        dprintf(idx, "%sI didn't know you had a boyfriend, %s\n", prefix, nick);
 
280
        return;
275
281
      }
276
282
    }
277
283
    /* "my girlfriend" */
278
284
    else if (!egg_strcasecmp(word1, "girlfriend") ||
279
 
              !egg_strcasecmp(word1, "gf")) {
 
285
             !egg_strcasecmp(word1, "gf")) {
280
286
      strcpy(whotarget, getxtra(hand, "GF"));
281
287
      if (whotarget[0]) {
282
 
        sprintf(whoredirect, "%s, your girlfriend is %s, and ",
283
 
                nick, whotarget);
 
288
        sprintf(whoredirect, "%s, your girlfriend is %s, and ",
 
289
                nick, whotarget);
284
290
      } else {
285
 
        dprintf(idx,
286
 
                "%sI didn't know you had a girlfriend, %s\n",
287
 
                prefix, nick);
288
 
        return;
 
291
        dprintf(idx, "%sI didn't know you had a girlfriend, %s\n", prefix,
 
292
                nick);
 
293
        return;
289
294
      }
290
295
    } else {
291
 
      dprintf(idx,
292
 
              "%sI don't know anything about your %s, %s.\n",
293
 
              prefix, word1, nick);
 
296
      dprintf(idx, "%sI don't know anything about your %s, %s.\n", prefix,
 
297
              word1, nick);
294
298
      return;
295
299
    }
296
300
  }
300
304
    /* "your admin" */
301
305
    if (!egg_strcasecmp(word1, "owner") || !egg_strcasecmp(word1, "admin")) {
302
306
      if (admin[0]) {
303
 
        strcpy(word2, admin);
304
 
        wordshift(whotarget, word2);
305
 
        strcat(whoredirect, "My owner is ");
306
 
        strcat(whoredirect, whotarget);
307
 
        strcat(whoredirect, ", and ");
308
 
        if (!egg_strcasecmp(whotarget, hand)) {
309
 
          strcat(whoredirect, "that's YOU");
310
 
          if (!egg_strcasecmp(hand, nick)) {
311
 
            strcat(whoredirect, "!!!");
312
 
          } else {
313
 
            strcat(whoredirect, ", ");
314
 
            strcat(whoredirect, nick);
315
 
            strcat(whoredirect, "!");
316
 
          }
317
 
          dprintf(idx, "%s%s\n", prefix, whoredirect);
318
 
          return;
319
 
        }
320
 
      } else {                  /* owner variable munged or not set */
321
 
        dprintf(idx,
322
 
                "%sI don't seem to recall who my owner is right now...\n",
323
 
                prefix);
324
 
        return;
 
307
        strcpy(word2, admin);
 
308
        wordshift(whotarget, word2);
 
309
        strcat(whoredirect, "My owner is ");
 
310
        strcat(whoredirect, whotarget);
 
311
        strcat(whoredirect, ", and ");
 
312
        if (!egg_strcasecmp(whotarget, hand)) {
 
313
          strcat(whoredirect, "that's YOU");
 
314
          if (!egg_strcasecmp(hand, nick))
 
315
            strcat(whoredirect, "!!!");
 
316
          else {
 
317
            strcat(whoredirect, ", ");
 
318
            strcat(whoredirect, nick);
 
319
            strcat(whoredirect, "!");
 
320
          }
 
321
          dprintf(idx, "%s%s\n", prefix, whoredirect);
 
322
          return;
 
323
        }
 
324
      } else {                    /* owner variable munged or not set */
 
325
        dprintf(idx,
 
326
                "%sI don't seem to recall who my owner is right now...\n",
 
327
                prefix);
 
328
        return;
325
329
      }
326
 
    } else {                    /* no "your" target specified */
327
 
      dprintf(idx, "%sLet's not get personal, %s.\n",
328
 
              prefix, nick);
 
330
    } else {                      /* no "your" target specified */
 
331
      dprintf(idx, "%sLet's not get personal, %s.\n", prefix, nick);
329
332
      return;
330
333
    }
331
334
  }
343
346
  /* Looking for ones own nick? */
344
347
  if (!rfc_casecmp(nick, whotarget)) {
345
348
    dprintf(idx, "%s%sLooking for yourself, eh %s?\n",
346
 
            prefix, whoredirect, nick);
 
349
            prefix, whoredirect, nick);
347
350
    return;
348
351
  }
349
352
  /* Check if nick is on a channel */
355
358
      sprintf(word1, "%s!%s", whotarget, m->userhost);
356
359
      urec = get_user_by_host(word1);
357
360
      if (!urec || !egg_strcasecmp(whotarget, urec->handle))
358
 
        break;
 
361
        break;
359
362
      strcat(whoredirect, whotarget);
360
363
      strcat(whoredirect, " is ");
361
364
      strcat(whoredirect, urec->handle);
370
373
    while (chan) {
371
374
      m = chan->channel.member;
372
375
      while (m && m->nick[0]) {
373
 
        sprintf(word2, "%s!%s", m->nick, m->userhost);
374
 
        urec = get_user_by_host(word2);
375
 
        if (urec && !egg_strcasecmp(urec->handle, whotarget)) {
376
 
          onchan = 1;
377
 
          strcat(whoredirect, whotarget);
378
 
          strcat(whoredirect, " is ");
379
 
          strcat(whoredirect, m->nick);
380
 
          strcat(whoredirect, ", and ");
381
 
          strcpy(whotarget, m->nick);
382
 
          break;
383
 
        }
384
 
        m = m->next;
 
376
        sprintf(word2, "%s!%s", m->nick, m->userhost);
 
377
        urec = get_user_by_host(word2);
 
378
        if (urec && !egg_strcasecmp(urec->handle, whotarget)) {
 
379
          onchan = 1;
 
380
          strcat(whoredirect, whotarget);
 
381
          strcat(whoredirect, " is ");
 
382
          strcat(whoredirect, m->nick);
 
383
          strcat(whoredirect, ", and ");
 
384
          strcpy(whotarget, m->nick);
 
385
          break;
 
386
        }
 
387
        m = m->next;
385
388
      }
386
389
      chan = chan->next;
387
390
    }
392
395
    m = ismember(chan, whotarget);
393
396
    if (m && chan_issplit(m)) {
394
397
      dprintf(idx, "%s%s%s was just here, but got netsplit.\n",
395
 
              prefix, whoredirect, whotarget);
 
398
              prefix, whoredirect, whotarget);
396
399
      return;
397
400
    }
398
401
  }
399
402
  /* Check if the target IS on the channel */
400
403
  if (chan && m) {
401
404
    dprintf(idx, "%s%s%s is on the channel right now!\n",
402
 
            prefix, whoredirect, whotarget);
 
405
            prefix, whoredirect, whotarget);
403
406
    return;
404
407
  }
405
408
  /* Target not on this channel.   Check other channels */
408
411
    m = ismember(chan, whotarget);
409
412
    if (m && chan_issplit(m)) {
410
413
      dprintf(idx,
411
 
              "%s%s%s was just on %s, but got netsplit.\n",
412
 
              prefix, whoredirect, whotarget, chan->dname);
 
414
              "%s%s%s was just on %s, but got netsplit.\n",
 
415
              prefix, whoredirect, whotarget, chan->dname);
413
416
      return;
414
417
    }
415
418
    if (m) {
416
419
      dprintf(idx,
417
 
              "%s%s%s is on %s right now!\n",
418
 
              prefix, whoredirect, whotarget, chan->dname);
 
420
              "%s%s%s is on %s right now!\n",
 
421
              prefix, whoredirect, whotarget, chan->dname);
419
422
      return;
420
423
    }
421
424
    chan = chan->next;
426
429
  /* No match, then bail out */
427
430
  if (!urec) {
428
431
    dprintf(idx, "%s%sI don't know who %s is.\n",
429
 
            prefix, whoredirect, whotarget);
 
432
            prefix, whoredirect, whotarget);
430
433
    return;
431
434
  }
432
435
  /* We had a userlist match to a handle */
434
437
  for (i = 0; i < dcc_total; i++) {
435
438
    if (dcc[i].type->flags & DCT_CHAT) {
436
439
      if (!egg_strcasecmp(whotarget, dcc[i].nick)) {
437
 
        if (!rfc_casecmp(channel, dcc[i].u.chat->con_chan) &&
438
 
            dcc[i].u.chat->con_flags & LOG_PUBLIC) {
439
 
          strcat(whoredirect, whotarget);
440
 
          strcat(whoredirect,
441
 
           " is 'observing' this channel right now from my party line!");
442
 
          dprintf(idx, "%s%s\n", prefix, whoredirect);
443
 
        } else {
444
 
          dprintf(idx,
445
 
                  "%s%s%s is linked to me via DCC CHAT right now!\n",
446
 
                  prefix, whoredirect, whotarget);
447
 
        }
448
 
        return;
 
440
        if (!rfc_casecmp(channel, dcc[i].u.chat->con_chan) &&
 
441
            dcc[i].u.chat->con_flags & LOG_PUBLIC) {
 
442
          strcat(whoredirect, whotarget);
 
443
          strcat(whoredirect,
 
444
                 " is 'observing' this channel right now from my party line!");
 
445
          dprintf(idx, "%s%s\n", prefix, whoredirect);
 
446
        } else {
 
447
          dprintf(idx,
 
448
                  "%s%s%s is linked to me via DCC CHAT right now!\n",
 
449
                  prefix, whoredirect, whotarget);
 
450
        }
 
451
        return;
449
452
      }
450
453
    }
451
454
  }
456
459
  else
457
460
    for (cr = urec->chanrec; cr; cr = cr->next) {
458
461
      if (!rfc_casecmp(cr->channel, channel)) {
459
 
        if (cr->laston) {
460
 
          laston = cr->laston;
461
 
          lastonplace = channel;
462
 
          break;
463
 
        }
 
462
        if (cr->laston) {
 
463
          laston = cr->laston;
 
464
          lastonplace = channel;
 
465
          break;
 
466
        }
464
467
      }
465
468
    }
466
469
  if (!cr) {
467
470
    li = get_user(&USERENTRY_LASTON, urec);
468
471
    if (!li || !li->lastonplace || !li->lastonplace[0]) {
469
472
      dprintf(idx, "%s%sI've never seen %s around.\n",
470
 
              prefix, whoredirect, whotarget);
 
473
              prefix, whoredirect, whotarget);
471
474
      return;
472
475
    }
473
476
    lastonplace = li->lastonplace;
478
481
  work = now - laston;
479
482
  if (work >= 86400) {
480
483
    sprintf(word2, "%lu day%s, ", work / 86400,
481
 
            ((work / 86400) == 1) ? "" : "s");
 
484
            ((work / 86400) == 1) ? "" : "s");
482
485
    work = work % 86400;
483
486
  }
484
487
  if (work >= 3600) {
485
488
    sprintf(word2 + strlen(word2), "%lu hour%s, ", work / 3600,
486
 
            ((work / 3600) == 1) ? "" : "s");
 
489
            ((work / 3600) == 1) ? "" : "s");
487
490
    work = work % 3600;
488
491
  }
489
492
  if (work >= 60) {
490
493
    sprintf(word2 + strlen(word2), "%lu minute%s, ", work / 60,
491
 
            ((work / 60) == 1) ? "" : "s");
 
494
            ((work / 60) == 1) ? "" : "s");
492
495
  }
493
496
  if (!word2[0] && (work < 60)) {
494
497
    strcpy(word2, "just moments ago!!");
504
507
  else
505
508
    strcpy(word1, "seen");
506
509
  dprintf(idx, "%s%s%s was last %s %s\n",
507
 
          prefix, whoredirect, whotarget, word1, word2);
 
510
          prefix, whoredirect, whotarget, word1, word2);
508
511
}
509
512
 
510
513
static char fixit[512];
551
554
    ue = find_user_entry(&USERENTRY_XTRA, urec);
552
555
    if (ue)
553
556
      for (xk = ue->u.extra; xk; xk = xk->next)
554
 
        if (xk->key && !egg_strcasecmp(xk->key, field)) {
555
 
          if (xk->data[0] == '{' && xk->data[strlen(xk->data) - 1] == '}' &&
556
 
              strlen(xk->data) > 2) {
557
 
            strncpy(fixit, &xk->data[1], strlen(xk->data) - 2);
558
 
            fixit[strlen(xk->data) - 2] = 0;
559
 
            return fixit;
560
 
          } else {
561
 
            return xk->data;
562
 
          }
563
 
        }
 
557
        if (xk->key && !egg_strcasecmp(xk->key, field)) {
 
558
          if (xk->data[0] == '{' && xk->data[strlen(xk->data) - 1] == '}' &&
 
559
              strlen(xk->data) > 2) {
 
560
            strncpy(fixit, &xk->data[1], strlen(xk->data) - 2);
 
561
            fixit[strlen(xk->data) - 2] = 0;
 
562
            return fixit;
 
563
          } else {
 
564
            return xk->data;
 
565
          }
 
566
        }
564
567
  }
565
568
  return "";
566
569
}
579
582
/* Report on current seen info for .modulestat. */
580
583
static void seen_report(int idx, int details)
581
584
{
582
 
  if (details)
583
 
    dprintf(idx, "    seen.so - PUB, DCC and MSG \"seen\" commands.\n");
 
585
  if (details) {
 
586
    int size = seen_expmem();
 
587
 
 
588
    dprintf(idx, "    Using %d byte%s of memory\n", size,
 
589
            (size != 1) ? "s" : "");
 
590
  }
584
591
}
585
592
 
586
593
/* PUB channel builtin commands. */
587
 
static cmd_t seen_pub[] =
588
 
{
589
 
  {"seen",      "",     pub_seen,       NULL},
590
 
  {NULL,        NULL,   NULL,           NULL}
591
 
};
592
 
 
593
 
static cmd_t seen_dcc[] =
594
 
{
595
 
  {"seen",      "",     dcc_seen,       NULL},
596
 
  {NULL,        NULL,   NULL,           NULL}
597
 
};
598
 
 
599
 
static cmd_t seen_msg[] =
600
 
{
601
 
  {"seen",      "",     msg_seen,       NULL},
602
 
  {NULL,        NULL,   NULL,           NULL}
 
594
static cmd_t seen_pub[] = {
 
595
  {"seen", "",    pub_seen, NULL},
 
596
  {NULL,   NULL, NULL,      NULL}
 
597
};
 
598
 
 
599
static cmd_t seen_dcc[] = {
 
600
  {"seen", "",   dcc_seen, NULL},
 
601
  {NULL,   NULL, NULL,     NULL}
 
602
};
 
603
 
 
604
static cmd_t seen_msg[] = {
 
605
  {"seen", "",   msg_seen, NULL},
 
606
  {NULL,   NULL, NULL,     NULL}
603
607
};
604
608
 
605
609
static int server_seen_setup(char *mod)
620
624
  return 0;
621
625
}
622
626
 
623
 
static cmd_t seen_load[] =
624
 
{
625
 
  {"server",    "",     server_seen_setup,      NULL},
626
 
  {"irc",       "",     irc_seen_setup,         NULL},
627
 
  {NULL,        NULL,   NULL,                   NULL}
 
627
static cmd_t seen_load[] = {
 
628
  {"server", "",   server_seen_setup, NULL},
 
629
  {"irc",    "",   irc_seen_setup,    NULL},
 
630
  {NULL,     NULL, NULL,              NULL}
628
631
};
629
632
 
630
633
static char *seen_close()
644
647
 
645
648
EXPORT_SCOPE char *seen_start();
646
649
 
647
 
static Function seen_table[] =
648
 
{
 
650
static Function seen_table[] = {
649
651
  (Function) seen_start,
650
652
  (Function) seen_close,
651
653
  (Function) seen_expmem,
652
654
  (Function) seen_report,
653
655
};
654
656
 
655
 
char *seen_start(Function * egg_func_table)
 
657
char *seen_start(Function *egg_func_table)
656
658
{
657
659
  global = egg_func_table;
658
660
 
659
661
  module_register(MODULE_NAME, seen_table, 2, 0);
660
662
  if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) {
661
663
    module_undepend(MODULE_NAME);
662
 
    return "This module needs eggdrop1.6.0 or later";
 
664
    return "This module requires Eggdrop 1.6.0 or later.";
663
665
  }
664
666
  add_builtins(H_load, seen_load);
665
667
  add_builtins(H_dcc, seen_dcc);