Skip to content
Snippets Groups Projects
Commit 2a6f852f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'master' into 'master'

Sound toggle

See merge request !544
parents 092ce862 e8d4a501
No related branches found
No related tags found
1 merge request!544Sound toggle
Pipeline #8971 passed
......@@ -50,6 +50,7 @@ js.time_limit=0;
var input_state = 'chat';
var paused_msg_buffer = [];
var show_nicks = false;
var chat_sounds = false;
var stat_mode = 0; // 0 = Local Session stats (Chatters, Latency, & Mentions); 1 = Global MRC Stats
var mentions = [];
......@@ -78,7 +79,8 @@ const settings = {
show_nicks: f.iniGetObject('show_nicks') || {},
theme: f.iniGetObject('theme') || {},
msg_color: f.iniGetObject('msg_color') || {},
twit_list: f.iniGetObject('twit_list') || {}
twit_list: f.iniGetObject('twit_list') || {},
chat_sounds: f.iniGetObject('chat_sounds') || {}
};
f.close();
......@@ -344,7 +346,9 @@ function display_system_messages(frames) { // display local system messages (e.g
}
display_server_message(frames, "\x01k\x01h*.:\x01k\x01h__\x01n\x01w");
}
if (chat_sounds) {
console.beep();
}
file_removecase(NOTIF_FILE);
}
}
......@@ -400,6 +404,9 @@ function main() {
if (settings.twit_list[user.alias]) {
session.twit_list = settings.twit_list[user.alias].split(ascii(126));
}
if (settings.chat_sounds[user.alias]) {
session.chat_sounds = settings.chat_sounds[user.alias];
}
const frames = init_display(session.msg_color);
const inputline = new InputLine(frames.input);
......@@ -435,7 +442,9 @@ function main() {
if (session.twit_list.indexOf(msg.from_user.toLowerCase()) < 0) {
var mention = false;
if (msg.body.toUpperCase().indexOf(user.alias.toUpperCase()) >= 0 && msg.from_user !== user.alias) {
if (chat_sounds) {
console.beep();
}
mention = true;
session.mention_count = session.mention_count + 1;
refresh_stats(frames, session);
......@@ -607,6 +616,11 @@ function main() {
stat_mode = stat_mode === 0 ? 1 : 0;
refresh_stats(frames, session);
break;
case "sound":
chat_sounds = !chat_sounds;
display_server_message(frames, "\x01n\x01c\x01hChat sounds \x01w\x01h" + ( chat_sounds ? "ON" : "OFF" ) + "\x01c\x01h.\x01n\x01w");
save_setting(user.alias, "chat_sounds", chat_sounds);
break;
case "theme":
if (cmd.length == 2) {
set_theme( cmd[1] );
......
......@@ -28,7 +28,7 @@ f = undefined;
if (!settings.ssl)
settings.ssl=false;
const PROTOCOL_VERSION = '1.3.3';
const PROTOCOL_VERSION = '1.3.4';
const MAX_LINE = 512;
const FROM_SITE = system.name.replace(/ /g, "_");
const SYSTEM_NAME = system_info.system_name || system.name;
......
......@@ -11,6 +11,7 @@
WH/CmotdNHK:N Display the Message of the Day
WH/Cscroll Kor CPGUPK:N Scroll the chat window
WH/Cmentions Kor CUPK:N Reset mention counter and review mentions
WH/Csound K:N Toggle chat sounds (mentions & system msgs)
WH/CthemeNHK:N Select a theme HK..........N seeHK:N H/ChelpN Htheme
WH/CtwitNHK:N Twit List management HK....N seeHK:N H/ChelpN Htwit
WH/CctcpNHK:N Send a CTCP command HK.....N seeHK:N H/ChelpN Hctcp
......
......@@ -4,7 +4,7 @@
// See mrc-client.js for a bad example.
function MRC_Session(host, port, user, pass, alias) {
const MRC_VER = "Multi Relay Chat JS v1.3.3 2025-04-11 [cf]";
const MRC_VER = "Multi Relay Chat JS v1.3.4 2025-05-20 [cf]";
const CTCP_ROOM = "ctcp_echo_channel";
const handle = new Socket();
......
......@@ -84,8 +84,9 @@ mrc-client.ini:
to separate multiple commands.
splash: Whether the "Multi Relay Chat for Synchronet" splash is shown
on startup.
- The [aliases], [theme], [msg_color], [show_nicks], and [twit_list] sections
are for user settings which get added or updated any time a user uses them.
- The [aliases], [theme], [msg_color], [show_nicks], [twit_list], and
[chat_sounds] sections are for user settings which get added or updated any
time a user uses them.
4) MRC Stats
......@@ -151,7 +152,7 @@ file. Or just disable it by setting splash = false in mrc-client.ini
indicate the start of a sysop command. In the case of the MRC client, such
text is simply ignored and does not get sent over.
As a workround, you may simply insert a space in front of the message you
As a workaround, you may simply insert a space in front of the message you
want to send that starts with a semicolon.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment