mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Added '/ame' and '/amsg' command
This commit is contained in:
parent
8fe6110a93
commit
f731707fe7
3 changed files with 37 additions and 2 deletions
|
@ -3,8 +3,8 @@ Run your IRC client on a server and access it from the web browser. This gives y
|
|||
|
||||
### Commands
|
||||
These are the commands currently implemented:
|
||||
- [ ] /ame
|
||||
- [ ] /amsg
|
||||
- [x] /ame
|
||||
- [x] /amsg
|
||||
- [x] /close
|
||||
- [x] /connect
|
||||
- [x] /deop
|
||||
|
@ -29,6 +29,7 @@ These are the commands currently implemented:
|
|||
- [x] /say
|
||||
- [x] /send
|
||||
- [x] /server
|
||||
- [ ] /slap
|
||||
- [ ] /time
|
||||
- [x] /topic
|
||||
- [ ] /version
|
||||
|
|
|
@ -3,6 +3,8 @@ $(function() {
|
|||
var sidebar = $("#sidebar");
|
||||
|
||||
var commands = [
|
||||
"/ame",
|
||||
"/amsg",
|
||||
"/close",
|
||||
"/connect",
|
||||
"/deop",
|
||||
|
@ -187,6 +189,7 @@ $(function() {
|
|||
return;
|
||||
}
|
||||
input.val("");
|
||||
input.prev(".hint").val("");
|
||||
socket.emit("input", {
|
||||
id: form.data("target"),
|
||||
text: text,
|
||||
|
|
|
@ -186,6 +186,37 @@ function input(data) {
|
|||
});
|
||||
break;
|
||||
|
||||
case "ame":
|
||||
var type = "action";
|
||||
case "amsg":
|
||||
var user = client.me;
|
||||
var text = args.slice(1).join(" ");
|
||||
var channels = [];
|
||||
network.channels.forEach(function(chan) {
|
||||
if (chan.type == "channel") {
|
||||
channels.push(chan.name);
|
||||
var msg = new Msg({
|
||||
type: type,
|
||||
from: user,
|
||||
text: text,
|
||||
});
|
||||
chan.messages.push(msg)
|
||||
sockets.emit("msg", {
|
||||
id: chan.id,
|
||||
msg: msg,
|
||||
});
|
||||
}
|
||||
});
|
||||
client[type || "send"](
|
||||
channels,
|
||||
text
|
||||
);
|
||||
break;
|
||||
|
||||
case "ame":
|
||||
console.log("AME");
|
||||
break;
|
||||
|
||||
case "server":
|
||||
case "connect":
|
||||
if (args[1]) {
|
||||
|
|
Loading…
Reference in a new issue