Explorar o código

* LASTON sharing

svn: 1209
Bryan Drewery %!s(int64=22) %!d(string=hai) anos
pai
achega
a1e793abd6
Modificáronse 2 ficheiros con 25 adicións e 2 borrados
  1. 1 0
      doc/UPDATES
  2. 24 2
      src/userent.c

+ 1 - 0
doc/UPDATES

@@ -27,6 +27,7 @@ This is a summary of ChangeLog basically.
 * Sped up mode parsing
 * +take is now enforced much quicker (take() moved up ~300 lines of code)
 * +take now uses MAXMODES-1 deops
+* LAST info for .whois is now properly shared
 
 1.1.9
 

+ 24 - 2
src/userent.c

@@ -661,14 +661,36 @@ static int laston_set(struct userrec *u, struct user_entry *e, void *buf)
 
     li = e->u.extra = buf;
   }
-  /* donut share laston info */
+
+  if (!noshare) {
+    /* shareout(NULL, "c %s %s %s\n", e->type->name, u->handle, string); */
+    shareout(NULL, "c LASTON %s %s %li\n", u->handle, li->lastonplace ? li->lastonplace : "-", li->laston);
+  }
+
+  return 1;
+}
+
+static int laston_gotshare(struct userrec *u, struct user_entry *e, char *par, int idx)
+{
+  char *where = NULL;
+  time_t timeval = 0;
+
+  if (par[0])
+    where = newsplit(&par);
+  if (!strcmp(where, "-"))
+    where = NULL;
+  if (par[0])
+    timeval = atol(newsplit(&par));
+  touch_laston(u, where, timeval);
+
   return 1;
 }
 
+
 struct user_entry_type USERENTRY_LASTON =
 {
   0,				/* always 0 ;) */
-  0,
+  laston_gotshare,
   laston_unpack,
 #ifdef HUB
   laston_write_userfile,