Fossil

Check-in [381ad0c846]
Login

Check-in [381ad0c846]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 381ad0c8467a5032bf4b45ebdfe5f7453a37fe5ecaa4db7ab24be3d06b309c01
User & Date: stephan 2021-01-05 14:00:52.956
Context
2021-01-05
14:02
It's 2021 now, not 2020. ... (check-in: d0e81e5941 user: stephan tags: trunk)
14:00
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. ... (check-in: 381ad0c846 user: stephan tags: trunk)
13:20
Add build and zlib directories to the ignore-glob file, and change wbld to msvcbld in clean-glob file. ... (check-in: 443f4182f7 user: danield tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/chat.c.
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62







63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79
/*
** Outputs JS code to initialize a list of chat alert audio files for
** use by the chat front-end client. A handful of builtin files
** (from alerts/\*.wav) and all unversioned files matching
** alert-sounds/\*.{mp3,ogg,wav} are included.
*/
static void chat_emit_alert_list(void){
  Stmt q = empty_Stmt;
  unsigned int i;
  const char * azBuiltins[] = {
  "builtin/alerts/plunk.wav",
  "builtin/alerts/b-flat.wav",
  "builtin/alerts/g-minor-triad.wav"
  };
  CX("window.fossil.config.chat.alerts = [\n");
  for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){
    CX("%s%!j", i ? ", " : "", azBuiltins[i]);
  }







  db_prepare(&q, "SELECT 'uv/'||name FROM unversioned "
             "WHERE content IS NOT NULL "
             "AND (name LIKE 'alert-sounds/%%.wav' "
             "OR name LIKE 'alert-sounds/%%.mp3' "
             "OR name LIKE 'alert-sounds/%%.ogg')");
  while(SQLITE_ROW==db_step(&q)){
    CX(", %!j", db_column_text(&q, 0));
  }
  db_finalize(&q);

  CX("\n].sort();\n");
}

/* Settings that can be used to control chat */
/*
** SETTING: chat-initial-history    width=10 default=50
**
** If this setting has an integer value of N, then when /chat first







|



|
<





>
>
>
>
>
>
>









>
|







45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
** Outputs JS code to initialize a list of chat alert audio files for
** use by the chat front-end client. A handful of builtin files
** (from alerts/\*.wav) and all unversioned files matching
** alert-sounds/\*.{mp3,ogg,wav} are included.
*/
static void chat_emit_alert_list(void){
  /*Stmt q = empty_Stmt;*/
  unsigned int i;
  const char * azBuiltins[] = {
  "builtin/alerts/plunk.wav",
  "builtin/alerts/b-flat.wav"

  };
  CX("window.fossil.config.chat.alerts = [\n");
  for(i=0; i < sizeof(azBuiltins)/sizeof(azBuiltins[0]); ++i){
    CX("%s%!j", i ? ", " : "", azBuiltins[i]);
  }
#if 0
  /*
  ** 2020-01-05 temporarily disabled until we decide whether we're
  ** going to keep configurable audio files or not. If we do, this
  ** code needs to check whether the [unversioned] table exists before
  ** querying it.
  */
  db_prepare(&q, "SELECT 'uv/'||name FROM unversioned "
             "WHERE content IS NOT NULL "
             "AND (name LIKE 'alert-sounds/%%.wav' "
             "OR name LIKE 'alert-sounds/%%.mp3' "
             "OR name LIKE 'alert-sounds/%%.ogg')");
  while(SQLITE_ROW==db_step(&q)){
    CX(", %!j", db_column_text(&q, 0));
  }
  db_finalize(&q);
#endif
  CX("\n];\n");
}

/* Settings that can be used to control chat */
/*
** SETTING: chat-initial-history    width=10 default=50
**
** If this setting has an integer value of N, then when /chat first
Changes to www/chat.md.
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
at the top of the message and clicking the button which appears. Such
deletions are local-only and the messages will reappear if the page
page is reloaded. Admin users may additionally choose to globally
delete a message from the chat record, which deletes it not only from
their own browser but also propagates the removal to all connected
clients the next time they poll for new messages.

### Audible Notifications

On platforms which support it, chat can optionally play an audio file
when a new message arrives from any user other than oneself. The sound
can be selected or disabled via the settings menu. The list of sounds
includes a small selection of sounds built in to the fossil binary and
new sound files may be added to a repository as unversioned content:
when the chat page is loaded, it includes a list of all unversioned
files named `alert-sounds/*.XYZ`, where `XYZ` is one of (`wav`, `mp3`,
`ogg`) case-insensitive.

For example, a Unix-style shell command like the following would
install all WAV files in a local directory to the list:

```
for i in *.wav; do fossil uv add "$i" --as "alert-sounds/$i"; done
```

The list of sound files is sorted client-side for display in the
selection list. The user's selection of audio file is persistent in
a given browser, but if the file is subsequently removed from the
server then the next time the chat page is reloaded the sound will
fall back to the first one in the selection list.

## Implementation Details

*You do not need to understand how Fossil chat works in order to use it.
But many developers prefer to know how their tools work.
This section is provided for the benefit of those curious developers.*

The [/chat](/help?cmd=/chat) webpage downloads a small amount of HTML







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







97
98
99
100
101
102
103
























104
105
106
107
108
109
110
at the top of the message and clicking the button which appears. Such
deletions are local-only and the messages will reappear if the page
page is reloaded. Admin users may additionally choose to globally
delete a message from the chat record, which deletes it not only from
their own browser but also propagates the removal to all connected
clients the next time they poll for new messages.

























## Implementation Details

*You do not need to understand how Fossil chat works in order to use it.
But many developers prefer to know how their tools work.
This section is provided for the benefit of those curious developers.*

The [/chat](/help?cmd=/chat) webpage downloads a small amount of HTML