Fossil

Check-in [2a59a9a15a]
Login

Check-in [2a59a9a15a]

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

Overview
Comment:/chat: re-enable inclusion of unversioned sound files (mp3, wav, ogg) in the list of chat notification sounds.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | chat-config-options
Files: files | file ages | folders
SHA3-256: 2a59a9a15a6c5815bb0052bda86e91f228e3e74d2ad65a5589ba13c6adc56e2f
User & Date: stephan 2021-09-18 02:36:04.468
Context
2021-09-18
03:26
/chat: Corrected storage of selected audio URI to account for multiple sounds. Updated change log and chat.md. ... (Closed-Leaf check-in: c23aa77411 user: stephan tags: chat-config-options)
02:36
/chat: re-enable inclusion of unversioned sound files (mp3, wav, ogg) in the list of chat notification sounds. ... (check-in: 2a59a9a15a user: stephan tags: chat-config-options)
2021-09-17
23:24
Removed dev-mode-only automatic toggle of config area. ... (check-in: 563ce12aca user: stephan tags: chat-config-options)
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
80

81
82
83
84
85
86
87
/*
** 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/bflat2.wav",
  "builtin/alerts/bflat3.wav",
  "builtin/alerts/bloop.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
  /*
  ** 2021-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
**







<











<
<
<
<
|
|
<
|
|
|
|
|
|
|
|
|
<
>







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
/*
** 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){

  unsigned int i;
  const char * azBuiltins[] = {
  "builtin/alerts/plunk.wav",
  "builtin/alerts/bflat2.wav",
  "builtin/alerts/bflat3.wav",
  "builtin/alerts/bloop.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( db_table_exists("repository","unversioned") ){
    Stmt q = empty_Stmt;

    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];\n");
}

/* Settings that can be used to control chat */
/*
** SETTING: chat-initial-history    width=10 default=50
**