* Added the ISME command (find out if some arbitrary e-mail address "is me")
authorArt Cancro <ajc@citadel.org>
Thu, 28 Nov 2002 05:58:13 +0000 (05:58 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 28 Nov 2002 05:58:13 +0000 (05:58 +0000)
citadel/citserver.c
citadel/msgbase.c
citadel/msgbase.h
citadel/techdoc/session.txt

index 04562d1aac24f30ef13c6203ce1b7691c1b85a5a..86e30c91b678fb090641bc4bfbf03f86a6e68a38 100644 (file)
@@ -1266,6 +1266,10 @@ void do_command_loop(void) {
                cmd_view(&cmdbuf[5]);
        }
 
+       else if (!strncasecmp(cmdbuf, "ISME", 4)) {
+               cmd_isme(&cmdbuf[5]);
+       }
+
 #ifdef DEBUG_MEMORY_LEAKS
        else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
                dump_tracked();
index 471d8901c8ad1d020cda5f4a9e91841be48ce7af..c13f744074f12d58fe3471f15abf4d5c754d70aa 100644 (file)
@@ -3178,3 +3178,38 @@ void CtdlPutSysConfig(char *sysconfname, char *sysconfdata) {
        CtdlWriteObject(SYSCONFIGROOM, sysconfname, temp, NULL, 0, 1, 0);
        unlink(temp);
 }
+
+
+void cmd_isme(char *argbuf) {
+       char addr[SIZ];
+       struct recptypes *recp;
+       int i;
+
+       if (CtdlAccessCheck(ac_logged_in)) return;
+       extract(addr, argbuf, 0);
+       recp = validate_recipients(addr);
+
+       if (recp == NULL) {
+               cprintf("%d Error parsing \n", ERROR + INTERNAL_ERROR);
+               return;
+       }
+
+       if (recp->num_local == 0) {
+               cprintf("%d Not you.\n", ERROR);
+               phree(recp);
+               return;
+       }
+
+       for (i=0; i<recp->num_local; ++i) {
+               extract(addr, recp->recp_local, i);
+               if (!strcasecmp(addr, CC->usersupp.fullname)) {
+                       cprintf("%d %s\n", CIT_OK, addr);
+                       phree(recp);
+                       return;
+               }
+       }
+
+       cprintf("%d Not you.\n", ERROR);
+       phree(recp);
+       return;
+}
index 9f40974fd910b6e80fd673022bf5ad5a7bb5cb49..76696b2bcab8df85edc894656dfd4c85f7c38671 100644 (file)
@@ -70,6 +70,7 @@ struct recptypes {
 int alias (char *name);
 void get_mm (void);
 void cmd_msgs (char *cmdbuf);
+void cmd_isme (char *cmdbuf);
 void help_subst (char *strbuf, char *source, char *dest);
 void do_help_subst (char *buffer);
 void memfmout (int width, char *mptr, char subst, char *nl);
index a801bbc2c4f7fc5583aa258629f3ef08a67de32c..94a82bb973a207009ca83fbe55a3d7d74efb5c6a 100644 (file)
@@ -1938,7 +1938,15 @@ call QDIR with one parameter, the Internet e-mail address to look up.  QDIR
 returns OK followed by a Citadel address if there is a match, otherwise it
 returns ERROR+NOT_LOGGED_IN.
  
+  
+ ISME   (find out if an e-mail address IS ME)
+  
+ This is a quickie shortcut command to find out if a given e-mail address
+belongs to the user currently logged in.  Its sole argument is an address to
+parse.  The supplied address may be in any format (local, IGnet, or Internet).
+The command returns OK if the address belongs to the user, ERROR otherwise.
+  
+  
  VIEW   (set the VIEW for a room)
  
  Set the preferred view for the current user in the current room.  Please see