]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-timestamp.c
Merge default into chanserv-live.
[irc/quakenet/newserv.git] / newsearch / ns-timestamp.c
index 8cc070d925488adca973b4ea62106afa3f84d7fa..433c26a0567f2be1676d9940333b5e5aba54e0e0 100644 (file)
@@ -31,8 +31,16 @@ struct searchNode *timestamp_parse(searchCtx *ctx, int argc, char **argv) {
 
 void *timestamp_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   nick *np = (nick *)theinput;
-
-  return (void *)np->timestamp;
+  chanindex *cip = (chanindex *)theinput;
+
+  if (ctx->searchcmd == reg_nicksearch || ctx->searchcmd == reg_whowassearch) {
+    return (void *)np->timestamp;
+  } else {
+    if (cip->channel)
+      return (void *)cip->channel->timestamp;
+    else
+      return 0;
+  }
 }
 
 void timestamp_free(searchCtx *ctx, struct searchNode *thenode) {