Fossil SCM

Removed the reference to the unversioned table from the chat alert list generation, since that table is optional and the alerts are currently disabled (problem reported in [https://fossil-scm.org/forum/forumpost/f3a522489b | /forumpost/f3a522489b]. Removed mention of the configurable alerts from chat.md.

stephan 2021-01-05 14:00 trunk
Commit 381ad0c8467a5032bf4b45ebdfe5f7453a37fe5ecaa4db7ab24be3d06b309c01
2 files changed +11 -4 -24
+11 -4
--- src/chat.c
+++ src/chat.c
@@ -47,31 +47,38 @@
4747
** use by the chat front-end client. A handful of builtin files
4848
** (from alerts/\*.wav) and all unversioned files matching
4949
** alert-sounds/\*.{mp3,ogg,wav} are included.
5050
*/
5151
static void chat_emit_alert_list(void){
52
- Stmt q = empty_Stmt;
52
+ /*Stmt q = empty_Stmt;*/
5353
unsigned int i;
5454
const char * azBuiltins[] = {
5555
"builtin/alerts/plunk.wav",
56
- "builtin/alerts/b-flat.wav",
57
- "builtin/alerts/g-minor-triad.wav"
56
+ "builtin/alerts/b-flat.wav"
5857
};
5958
CX("window.fossil.config.chat.alerts = [\n");
6059
for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){
6160
CX("%s%!j", i ? ", " : "", azBuiltins[i]);
6261
}
62
+#if 0
63
+ /*
64
+ ** 2020-01-05 temporarily disabled until we decide whether we're
65
+ ** going to keep configurable audio files or not. If we do, this
66
+ ** code needs to check whether the [unversioned] table exists before
67
+ ** querying it.
68
+ */
6369
db_prepare(&q, "SELECT 'uv/'||name FROM unversioned "
6470
"WHERE content IS NOT NULL "
6571
"AND (name LIKE 'alert-sounds/%%.wav' "
6672
"OR name LIKE 'alert-sounds/%%.mp3' "
6773
"OR name LIKE 'alert-sounds/%%.ogg')");
6874
while(SQLITE_ROW==db_step(&q)){
6975
CX(", %!j", db_column_text(&q, 0));
7076
}
7177
db_finalize(&q);
72
- CX("\n].sort();\n");
78
+#endif
79
+ CX("\n];\n");
7380
}
7481
7582
/* Settings that can be used to control chat */
7683
/*
7784
** SETTING: chat-initial-history width=10 default=50
7885
--- src/chat.c
+++ src/chat.c
@@ -47,31 +47,38 @@
47 ** use by the chat front-end client. A handful of builtin files
48 ** (from alerts/\*.wav) and all unversioned files matching
49 ** alert-sounds/\*.{mp3,ogg,wav} are included.
50 */
51 static void chat_emit_alert_list(void){
52 Stmt q = empty_Stmt;
53 unsigned int i;
54 const char * azBuiltins[] = {
55 "builtin/alerts/plunk.wav",
56 "builtin/alerts/b-flat.wav",
57 "builtin/alerts/g-minor-triad.wav"
58 };
59 CX("window.fossil.config.chat.alerts = [\n");
60 for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){
61 CX("%s%!j", i ? ", " : "", azBuiltins[i]);
62 }
 
 
 
 
 
 
 
63 db_prepare(&q, "SELECT 'uv/'||name FROM unversioned "
64 "WHERE content IS NOT NULL "
65 "AND (name LIKE 'alert-sounds/%%.wav' "
66 "OR name LIKE 'alert-sounds/%%.mp3' "
67 "OR name LIKE 'alert-sounds/%%.ogg')");
68 while(SQLITE_ROW==db_step(&q)){
69 CX(", %!j", db_column_text(&q, 0));
70 }
71 db_finalize(&q);
72 CX("\n].sort();\n");
 
73 }
74
75 /* Settings that can be used to control chat */
76 /*
77 ** SETTING: chat-initial-history width=10 default=50
78
--- src/chat.c
+++ src/chat.c
@@ -47,31 +47,38 @@
47 ** use by the chat front-end client. A handful of builtin files
48 ** (from alerts/\*.wav) and all unversioned files matching
49 ** alert-sounds/\*.{mp3,ogg,wav} are included.
50 */
51 static void chat_emit_alert_list(void){
52 /*Stmt q = empty_Stmt;*/
53 unsigned int i;
54 const char * azBuiltins[] = {
55 "builtin/alerts/plunk.wav",
56 "builtin/alerts/b-flat.wav"
 
57 };
58 CX("window.fossil.config.chat.alerts = [\n");
59 for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){
60 CX("%s%!j", i ? ", " : "", azBuiltins[i]);
61 }
62 #if 0
63 /*
64 ** 2020-01-05 temporarily disabled until we decide whether we're
65 ** going to keep configurable audio files or not. If we do, this
66 ** code needs to check whether the [unversioned] table exists before
67 ** querying it.
68 */
69 db_prepare(&q, "SELECT 'uv/'||name FROM unversioned "
70 "WHERE content IS NOT NULL "
71 "AND (name LIKE 'alert-sounds/%%.wav' "
72 "OR name LIKE 'alert-sounds/%%.mp3' "
73 "OR name LIKE 'alert-sounds/%%.ogg')");
74 while(SQLITE_ROW==db_step(&q)){
75 CX(", %!j", db_column_text(&q, 0));
76 }
77 db_finalize(&q);
78 #endif
79 CX("\n];\n");
80 }
81
82 /* Settings that can be used to control chat */
83 /*
84 ** SETTING: chat-initial-history width=10 default=50
85
-24
--- www/chat.md
+++ www/chat.md
@@ -99,34 +99,10 @@
9999
page is reloaded. Admin users may additionally choose to globally
100100
delete a message from the chat record, which deletes it not only from
101101
their own browser but also propagates the removal to all connected
102102
clients the next time they poll for new messages.
103103
104
-### Audible Notifications
105
-
106
-On platforms which support it, chat can optionally play an audio file
107
-when a new message arrives from any user other than oneself. The sound
108
-can be selected or disabled via the settings menu. The list of sounds
109
-includes a small selection of sounds built in to the fossil binary and
110
-new sound files may be added to a repository as unversioned content:
111
-when the chat page is loaded, it includes a list of all unversioned
112
-files named `alert-sounds/*.XYZ`, where `XYZ` is one of (`wav`, `mp3`,
113
-`ogg`) case-insensitive.
114
-
115
-For example, a Unix-style shell command like the following would
116
-install all WAV files in a local directory to the list:
117
-
118
-```
119
-for i in *.wav; do fossil uv add "$i" --as "alert-sounds/$i"; done
120
-```
121
-
122
-The list of sound files is sorted client-side for display in the
123
-selection list. The user's selection of audio file is persistent in
124
-a given browser, but if the file is subsequently removed from the
125
-server then the next time the chat page is reloaded the sound will
126
-fall back to the first one in the selection list.
127
-
128104
## Implementation Details
129105
130106
*You do not need to understand how Fossil chat works in order to use it.
131107
But many developers prefer to know how their tools work.
132108
This section is provided for the benefit of those curious developers.*
133109
--- www/chat.md
+++ www/chat.md
@@ -99,34 +99,10 @@
99 page is reloaded. Admin users may additionally choose to globally
100 delete a message from the chat record, which deletes it not only from
101 their own browser but also propagates the removal to all connected
102 clients the next time they poll for new messages.
103
104 ### Audible Notifications
105
106 On platforms which support it, chat can optionally play an audio file
107 when a new message arrives from any user other than oneself. The sound
108 can be selected or disabled via the settings menu. The list of sounds
109 includes a small selection of sounds built in to the fossil binary and
110 new sound files may be added to a repository as unversioned content:
111 when the chat page is loaded, it includes a list of all unversioned
112 files named `alert-sounds/*.XYZ`, where `XYZ` is one of (`wav`, `mp3`,
113 `ogg`) case-insensitive.
114
115 For example, a Unix-style shell command like the following would
116 install all WAV files in a local directory to the list:
117
118 ```
119 for i in *.wav; do fossil uv add "$i" --as "alert-sounds/$i"; done
120 ```
121
122 The list of sound files is sorted client-side for display in the
123 selection list. The user's selection of audio file is persistent in
124 a given browser, but if the file is subsequently removed from the
125 server then the next time the chat page is reloaded the sound will
126 fall back to the first one in the selection list.
127
128 ## Implementation Details
129
130 *You do not need to understand how Fossil chat works in order to use it.
131 But many developers prefer to know how their tools work.
132 This section is provided for the benefit of those curious developers.*
133
--- www/chat.md
+++ www/chat.md
@@ -99,34 +99,10 @@
99 page is reloaded. Admin users may additionally choose to globally
100 delete a message from the chat record, which deletes it not only from
101 their own browser but also propagates the removal to all connected
102 clients the next time they poll for new messages.
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104 ## Implementation Details
105
106 *You do not need to understand how Fossil chat works in order to use it.
107 But many developers prefer to know how their tools work.
108 This section is provided for the benefit of those curious developers.*
109

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button