Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /amsg command #745

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion client/src/misc/clientuicommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
'unknown_command': unknownCommand,
'command': allCommands,
'command:msg': {fn: msgCommand, description: translateText('command_description_msg')},
'command:amsg': {fn: amsgCommand, description: translateText('command_description_amsg')},
'command:action': {fn: actionCommand, description: translateText('command_description_action')},
'command:join': {fn: joinCommand, description: translateText('command_description_join')},
'command:part': {fn: partCommand, description: translateText('command_description_part')},
Expand Down Expand Up @@ -319,6 +320,20 @@
}


function amsgCommand (ev) {
var panels = this.app.connections.active_connection.panels,
message = ev.params.join(' ');

panels.forEach(_.bind(function(panel) {
// Send the message to all channels
if(panel.isChannel()) {
panel.addMsg(this.app.connections.active_connection.get('nick'), styleText('privmsg', {text: message}), 'privmsg');
this.app.connections.active_connection.gateway.msg(panel.get('name'), message);
}
}, this));
}


function actionCommand (ev) {
if (this.app.panels().active.isServer()) {
return;
Expand Down Expand Up @@ -421,7 +436,6 @@
this.app.connections.active_connection.gateway.kick(panel.get('name'), nick, ev.params.join(' '));
}


function clearCommand (ev) {
// Can't clear a server or applet panel
if (this.app.panels().active.isServer() || this.app.panels().active.isApplet()) {
Expand Down