Fossil SCM
The email_auto_exec property is removed. The routine that sends alert emails is renamed to email_backoffice() and it is configured to always auto-run.
Commit
ada7ecde5bf91e18fdaee1367f0aa25cf48830dd06ecfcbedc9783977728d737
Parent
f525b6d5e9dcb77…
2 files changed
+1
-1
+8
-18
+1
-1
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -249,11 +249,11 @@ | ||
| 249 | 249 | /* |
| 250 | 250 | ** This routine runs to do the backoffice processing. When adding new |
| 251 | 251 | ** backoffice processing tasks, add them here. |
| 252 | 252 | */ |
| 253 | 253 | void backoffice_work(void){ |
| 254 | - email_auto_exec(0); | |
| 254 | + email_backoffice(0); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /* |
| 258 | 258 | ** COMMAND: test-backoffice |
| 259 | 259 | ** |
| 260 | 260 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -249,11 +249,11 @@ | |
| 249 | /* |
| 250 | ** This routine runs to do the backoffice processing. When adding new |
| 251 | ** backoffice processing tasks, add them here. |
| 252 | */ |
| 253 | void backoffice_work(void){ |
| 254 | email_auto_exec(0); |
| 255 | } |
| 256 | |
| 257 | /* |
| 258 | ** COMMAND: test-backoffice |
| 259 | ** |
| 260 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -249,11 +249,11 @@ | |
| 249 | /* |
| 250 | ** This routine runs to do the backoffice processing. When adding new |
| 251 | ** backoffice processing tasks, add them here. |
| 252 | */ |
| 253 | void backoffice_work(void){ |
| 254 | email_backoffice(0); |
| 255 | } |
| 256 | |
| 257 | /* |
| 258 | ** COMMAND: test-backoffice |
| 259 | ** |
| 260 |
+8
-18
| --- src/email.c | ||
| +++ src/email.c | ||
| @@ -245,19 +245,10 @@ | ||
| 245 | 245 | @ Subject: line of email alerts. Traditionally this name is |
| 246 | 246 | @ included in square brackets. Examples: "[fossil-src]", "[sqlite-src]". |
| 247 | 247 | @ (Property: "email-subname")</p> |
| 248 | 248 | @ <hr> |
| 249 | 249 | |
| 250 | - onoff_attribute("Automatic Email Exec", "email-autoexec", | |
| 251 | - "eauto", 0, 0); | |
| 252 | - @ <p>If enabled, then email notifications are automatically | |
| 253 | - @ dispatched after some webpages are accessed. This eliminates the | |
| 254 | - @ need to have a cron job running to invoke "fossil email exec" | |
| 255 | - @ periodically. | |
| 256 | - @ (Property: "email-autoexec")</p> | |
| 257 | - @ <hr> | |
| 258 | - | |
| 259 | 250 | multiple_choice_attribute("Email Send Method", "email-send-method", "esm", |
| 260 | 251 | "off", count(azSendMethods)/2, azSendMethods); |
| 261 | 252 | @ <p>How to send email. Requires auxiliary information from the fields |
| 262 | 253 | @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page |
| 263 | 254 | @ to send test message to debug this setting. |
| @@ -1945,11 +1936,11 @@ | ||
| 1945 | 1936 | } |
| 1946 | 1937 | |
| 1947 | 1938 | /* |
| 1948 | 1939 | ** COMMAND: test-add-alerts |
| 1949 | 1940 | ** |
| 1950 | -** Usage: %fossil test-add-alerts [--autoexec] EVENTID ... | |
| 1941 | +** Usage: %fossil test-add-alerts [--backoffice] EVENTID ... | |
| 1951 | 1942 | ** |
| 1952 | 1943 | ** Add one or more events to the pending_alert queue. Use this |
| 1953 | 1944 | ** command during testing to force email notifications for specific |
| 1954 | 1945 | ** events. |
| 1955 | 1946 | ** |
| @@ -1956,27 +1947,27 @@ | ||
| 1956 | 1947 | ** EVENTIDs are text. The first character is 'c', 'w', or 't' |
| 1957 | 1948 | ** for check-in, wiki, or ticket. The remaining text is a |
| 1958 | 1949 | ** integer that references the EVENT.OBJID value for the event. |
| 1959 | 1950 | ** Run /timeline?showid to see these OBJID values. |
| 1960 | 1951 | ** |
| 1961 | -** If the --autoexec option is included, then email_auto_exec() is run | |
| 1952 | +** If the --backoffice option is included, then email_backoffice() is run | |
| 1962 | 1953 | ** after all alerts have been added. This will cause the alerts to |
| 1963 | 1954 | ** be sent out with the SENDALERT_TRACE option. |
| 1964 | 1955 | */ |
| 1965 | 1956 | void test_add_alert_cmd(void){ |
| 1966 | 1957 | int i; |
| 1967 | - int doAuto = find_option("autoexec",0,0)!=0; | |
| 1958 | + int doAuto = find_option("backoffice",0,0)!=0; | |
| 1968 | 1959 | db_find_and_open_repository(0, 0); |
| 1969 | 1960 | verify_all_options(); |
| 1970 | 1961 | db_begin_write(); |
| 1971 | 1962 | email_schema(0); |
| 1972 | 1963 | for(i=2; i<g.argc; i++){ |
| 1973 | 1964 | db_multi_exec("REPLACE INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); |
| 1974 | 1965 | } |
| 1975 | 1966 | db_end_transaction(0); |
| 1976 | 1967 | if( doAuto ){ |
| 1977 | - email_auto_exec(SENDALERT_TRACE); | |
| 1968 | + email_backoffice(SENDALERT_TRACE); | |
| 1978 | 1969 | } |
| 1979 | 1970 | } |
| 1980 | 1971 | |
| 1981 | 1972 | #if INTERFACE |
| 1982 | 1973 | /* |
| @@ -2092,24 +2083,23 @@ | ||
| 2092 | 2083 | if( g.fSqlTrace ) fossil_trace("-- END email_send_alerts(%u)\n", flags); |
| 2093 | 2084 | db_end_transaction(0); |
| 2094 | 2085 | } |
| 2095 | 2086 | |
| 2096 | 2087 | /* |
| 2097 | -** Check to see if any email notifications need to occur, and then | |
| 2088 | +** Do backoffice processing for email notifications. In other words, | |
| 2089 | +** check to see if any email notifications need to occur, and then | |
| 2098 | 2090 | ** do them. |
| 2099 | 2091 | ** |
| 2100 | -** This routine is called after certain webpages have been run and | |
| 2101 | -** have already responded. | |
| 2092 | +** This routine is intended to run in the background, after webpages. | |
| 2102 | 2093 | ** |
| 2103 | 2094 | ** The mFlags option is zero or more of the SENDALERT_* flags. Normally |
| 2104 | 2095 | ** this flag is zero, but the test-set-alert command sets it to |
| 2105 | 2096 | ** SENDALERT_TRACE. |
| 2106 | 2097 | */ |
| 2107 | -void email_auto_exec(u32 mFlags){ | |
| 2098 | +void email_backoffice(u32 mFlags){ | |
| 2108 | 2099 | int iJulianDay; |
| 2109 | 2100 | if( !email_tables_exist() ) return; |
| 2110 | - if( !db_get_boolean("email-autoexec",0) ) return; | |
| 2111 | 2101 | email_send_alerts(mFlags); |
| 2112 | 2102 | iJulianDay = db_int(0, "SELECT julianday('now')"); |
| 2113 | 2103 | if( iJulianDay>db_get_int("email-last-digest",0) ){ |
| 2114 | 2104 | db_set_int("email-last-digest",iJulianDay,0); |
| 2115 | 2105 | email_send_alerts(SENDALERT_DIGEST|mFlags); |
| 2116 | 2106 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -245,19 +245,10 @@ | |
| 245 | @ Subject: line of email alerts. Traditionally this name is |
| 246 | @ included in square brackets. Examples: "[fossil-src]", "[sqlite-src]". |
| 247 | @ (Property: "email-subname")</p> |
| 248 | @ <hr> |
| 249 | |
| 250 | onoff_attribute("Automatic Email Exec", "email-autoexec", |
| 251 | "eauto", 0, 0); |
| 252 | @ <p>If enabled, then email notifications are automatically |
| 253 | @ dispatched after some webpages are accessed. This eliminates the |
| 254 | @ need to have a cron job running to invoke "fossil email exec" |
| 255 | @ periodically. |
| 256 | @ (Property: "email-autoexec")</p> |
| 257 | @ <hr> |
| 258 | |
| 259 | multiple_choice_attribute("Email Send Method", "email-send-method", "esm", |
| 260 | "off", count(azSendMethods)/2, azSendMethods); |
| 261 | @ <p>How to send email. Requires auxiliary information from the fields |
| 262 | @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page |
| 263 | @ to send test message to debug this setting. |
| @@ -1945,11 +1936,11 @@ | |
| 1945 | } |
| 1946 | |
| 1947 | /* |
| 1948 | ** COMMAND: test-add-alerts |
| 1949 | ** |
| 1950 | ** Usage: %fossil test-add-alerts [--autoexec] EVENTID ... |
| 1951 | ** |
| 1952 | ** Add one or more events to the pending_alert queue. Use this |
| 1953 | ** command during testing to force email notifications for specific |
| 1954 | ** events. |
| 1955 | ** |
| @@ -1956,27 +1947,27 @@ | |
| 1956 | ** EVENTIDs are text. The first character is 'c', 'w', or 't' |
| 1957 | ** for check-in, wiki, or ticket. The remaining text is a |
| 1958 | ** integer that references the EVENT.OBJID value for the event. |
| 1959 | ** Run /timeline?showid to see these OBJID values. |
| 1960 | ** |
| 1961 | ** If the --autoexec option is included, then email_auto_exec() is run |
| 1962 | ** after all alerts have been added. This will cause the alerts to |
| 1963 | ** be sent out with the SENDALERT_TRACE option. |
| 1964 | */ |
| 1965 | void test_add_alert_cmd(void){ |
| 1966 | int i; |
| 1967 | int doAuto = find_option("autoexec",0,0)!=0; |
| 1968 | db_find_and_open_repository(0, 0); |
| 1969 | verify_all_options(); |
| 1970 | db_begin_write(); |
| 1971 | email_schema(0); |
| 1972 | for(i=2; i<g.argc; i++){ |
| 1973 | db_multi_exec("REPLACE INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); |
| 1974 | } |
| 1975 | db_end_transaction(0); |
| 1976 | if( doAuto ){ |
| 1977 | email_auto_exec(SENDALERT_TRACE); |
| 1978 | } |
| 1979 | } |
| 1980 | |
| 1981 | #if INTERFACE |
| 1982 | /* |
| @@ -2092,24 +2083,23 @@ | |
| 2092 | if( g.fSqlTrace ) fossil_trace("-- END email_send_alerts(%u)\n", flags); |
| 2093 | db_end_transaction(0); |
| 2094 | } |
| 2095 | |
| 2096 | /* |
| 2097 | ** Check to see if any email notifications need to occur, and then |
| 2098 | ** do them. |
| 2099 | ** |
| 2100 | ** This routine is called after certain webpages have been run and |
| 2101 | ** have already responded. |
| 2102 | ** |
| 2103 | ** The mFlags option is zero or more of the SENDALERT_* flags. Normally |
| 2104 | ** this flag is zero, but the test-set-alert command sets it to |
| 2105 | ** SENDALERT_TRACE. |
| 2106 | */ |
| 2107 | void email_auto_exec(u32 mFlags){ |
| 2108 | int iJulianDay; |
| 2109 | if( !email_tables_exist() ) return; |
| 2110 | if( !db_get_boolean("email-autoexec",0) ) return; |
| 2111 | email_send_alerts(mFlags); |
| 2112 | iJulianDay = db_int(0, "SELECT julianday('now')"); |
| 2113 | if( iJulianDay>db_get_int("email-last-digest",0) ){ |
| 2114 | db_set_int("email-last-digest",iJulianDay,0); |
| 2115 | email_send_alerts(SENDALERT_DIGEST|mFlags); |
| 2116 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -245,19 +245,10 @@ | |
| 245 | @ Subject: line of email alerts. Traditionally this name is |
| 246 | @ included in square brackets. Examples: "[fossil-src]", "[sqlite-src]". |
| 247 | @ (Property: "email-subname")</p> |
| 248 | @ <hr> |
| 249 | |
| 250 | multiple_choice_attribute("Email Send Method", "email-send-method", "esm", |
| 251 | "off", count(azSendMethods)/2, azSendMethods); |
| 252 | @ <p>How to send email. Requires auxiliary information from the fields |
| 253 | @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page |
| 254 | @ to send test message to debug this setting. |
| @@ -1945,11 +1936,11 @@ | |
| 1936 | } |
| 1937 | |
| 1938 | /* |
| 1939 | ** COMMAND: test-add-alerts |
| 1940 | ** |
| 1941 | ** Usage: %fossil test-add-alerts [--backoffice] EVENTID ... |
| 1942 | ** |
| 1943 | ** Add one or more events to the pending_alert queue. Use this |
| 1944 | ** command during testing to force email notifications for specific |
| 1945 | ** events. |
| 1946 | ** |
| @@ -1956,27 +1947,27 @@ | |
| 1947 | ** EVENTIDs are text. The first character is 'c', 'w', or 't' |
| 1948 | ** for check-in, wiki, or ticket. The remaining text is a |
| 1949 | ** integer that references the EVENT.OBJID value for the event. |
| 1950 | ** Run /timeline?showid to see these OBJID values. |
| 1951 | ** |
| 1952 | ** If the --backoffice option is included, then email_backoffice() is run |
| 1953 | ** after all alerts have been added. This will cause the alerts to |
| 1954 | ** be sent out with the SENDALERT_TRACE option. |
| 1955 | */ |
| 1956 | void test_add_alert_cmd(void){ |
| 1957 | int i; |
| 1958 | int doAuto = find_option("backoffice",0,0)!=0; |
| 1959 | db_find_and_open_repository(0, 0); |
| 1960 | verify_all_options(); |
| 1961 | db_begin_write(); |
| 1962 | email_schema(0); |
| 1963 | for(i=2; i<g.argc; i++){ |
| 1964 | db_multi_exec("REPLACE INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); |
| 1965 | } |
| 1966 | db_end_transaction(0); |
| 1967 | if( doAuto ){ |
| 1968 | email_backoffice(SENDALERT_TRACE); |
| 1969 | } |
| 1970 | } |
| 1971 | |
| 1972 | #if INTERFACE |
| 1973 | /* |
| @@ -2092,24 +2083,23 @@ | |
| 2083 | if( g.fSqlTrace ) fossil_trace("-- END email_send_alerts(%u)\n", flags); |
| 2084 | db_end_transaction(0); |
| 2085 | } |
| 2086 | |
| 2087 | /* |
| 2088 | ** Do backoffice processing for email notifications. In other words, |
| 2089 | ** check to see if any email notifications need to occur, and then |
| 2090 | ** do them. |
| 2091 | ** |
| 2092 | ** This routine is intended to run in the background, after webpages. |
| 2093 | ** |
| 2094 | ** The mFlags option is zero or more of the SENDALERT_* flags. Normally |
| 2095 | ** this flag is zero, but the test-set-alert command sets it to |
| 2096 | ** SENDALERT_TRACE. |
| 2097 | */ |
| 2098 | void email_backoffice(u32 mFlags){ |
| 2099 | int iJulianDay; |
| 2100 | if( !email_tables_exist() ) return; |
| 2101 | email_send_alerts(mFlags); |
| 2102 | iJulianDay = db_int(0, "SELECT julianday('now')"); |
| 2103 | if( iJulianDay>db_get_int("email-last-digest",0) ){ |
| 2104 | db_set_int("email-last-digest",iJulianDay,0); |
| 2105 | email_send_alerts(SENDALERT_DIGEST|mFlags); |
| 2106 |