]> code.citadel.org Git - citadel.git/commitdiff
* Added the ability to run an external command from the client when new mail
authorArt Cancro <ajc@citadel.org>
Tue, 27 Aug 2002 04:01:03 +0000 (04:01 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 27 Aug 2002 04:01:03 +0000 (04:01 +0000)
  arrives.  (Ok, I admit it: I just discovered http://www.dailywav.com and I
  just *had* to have Bear in the Big Blue House tell me I've got mail)

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/commands.c
citadel/commands.h

index 7abaa2c9188a0275d58c4026d12a870a9aa3671a..bc513370837759c3c816b3439b478af11069fb29 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 591.103  2002/08/27 04:01:03  ajc
+ * Added the ability to run an external command from the client when new mail
+   arrives.  (Ok, I admit it: I just discovered http://www.dailywav.com and I
+   just *had* to have Bear in the Big Blue House tell me I've got mail)
+
  Revision 591.102  2002/08/26 02:55:09  ajc
  * Small bugfix for memory bounds checking in the MIME parser
 
@@ -3938,3 +3943,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index cfa0597595ccfddfb98fb92c0f17d39bea7aa30c..db1cb6261a6d7be328dec1885844382bf8208311 100644 (file)
@@ -461,6 +461,9 @@ void dotgoto(char *towhere, int display_name, int fromungoto)
                                        newmailcount);
                }
                color(DIM_WHITE);
+               if (strlen(rc_gotmail_cmd) > 0) {
+                       system(rc_gotmail_cmd);
+               }
        }
        status_line(serv_info.serv_humannode, serv_info.serv_bbs_city,
                        room_name, secure, newmailcount);
@@ -1188,6 +1191,9 @@ PWOK:
                        if (b > 1)
                                scr_printf("*** You have %d new private messages in Mail>\n", b);
                        color(DIM_WHITE);
+                       if (strlen(rc_gotmail_cmd) > 0) {
+                               system(rc_gotmail_cmd);
+                       }
                }
                if ((axlevel >= 6) && (chek.needvalid > 0)) {
                        scr_printf("*** Users need validation\n");
index b23e5ce558e8df1c3ba982d70e3951fd3fc451d4..d8765e801888a8e95a7de9059b3ebfec0ec149b0 100644 (file)
@@ -112,6 +112,11 @@ remember_passwords=0
 #
 #urlcmd=netscape -remote "openURL(%s)"
 
+# If GOTMAILCMD is defined, the specified command will be executed.  This
+# might be nice for playing sounds or providing any other type of notification.
+#
+#gotmailcmd=play gotmail.wav
+
 
 # MESSAGE READING SEMANTICS (experimental)
 #
index 2208a3ba45a3a517e85a4853e2fd1af2e1cee3e0..30e9a148001debfd7e201e1797e7bf48e5667a92 100644 (file)
@@ -80,6 +80,7 @@ int rc_prompt_control = 0;
 time_t rc_idle_threshold = (time_t)900;
 char urls[MAXURLS][SIZ];
 char rc_url_cmd[SIZ];
+char rc_gotmail_cmd[SIZ];
 
 char *gl_string;
 int next_lazy_cmd = 5;
@@ -735,6 +736,7 @@ void load_command_set(void)
        rc_force_mail_prompts = 0;
        rc_ansi_color = 0;
        strcpy(rc_url_cmd, "");
+       strcpy(rc_gotmail_cmd, "");
 #ifdef HAVE_OPENSSL
        rc_encrypt = RC_DEFAULT;
 #endif
@@ -857,6 +859,9 @@ void load_command_set(void)
                if (!strncasecmp(buf, "urlcmd=", 7))
                        strcpy(rc_url_cmd, &buf[7]);
 
+               if (!strncasecmp(buf, "gotmailcmd=", 11))
+                       strcpy(rc_gotmail_cmd, &buf[11]);
+
                if (!strncasecmp(buf, "alternate_semantics=", 20)) {
                        if (!strncasecmp(&buf[11], "yes", 3))
                                rc_alt_semantics = 1;
index 233a2d1e7347bfd2d43077013b215bd796c3a496..da20deaca4e78aa220c0dee146fc021f6a8ae5a8 100644 (file)
@@ -67,5 +67,6 @@ void pprintf(const char *format, ...);
 extern int num_urls;
 extern char urls[MAXURLS][SIZ];
 extern char rc_url_cmd[SIZ];
+extern char rc_gotmail_cmd[SIZ];
 extern int lines_printed;
 extern int rc_remember_passwords;