Switch to channel buffer on /join
Closes: https://todo.sr.ht/~emersion/gamja/37
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ const join = {
|
|||||||
if (!channel) {
|
if (!channel) {
|
||||||
throw new Error("Missing channel name");
|
throw new Error("Missing channel name");
|
||||||
}
|
}
|
||||||
getActiveClient(app).send({ command: "JOIN", params: [channel] });
|
app.open(channel);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -899,12 +899,13 @@ export default class App extends Component {
|
|||||||
var client = this.clients.get(netID);
|
var client = this.clients.get(netID);
|
||||||
|
|
||||||
if (this.isChannel(target)) {
|
if (this.isChannel(target)) {
|
||||||
|
this.switchToChannel = target;
|
||||||
client.send({ command: "JOIN", params: [target] });
|
client.send({ command: "JOIN", params: [target] });
|
||||||
} else {
|
} else {
|
||||||
client.send({ command: "WHO", params: [target] });
|
client.send({ command: "WHO", params: [target] });
|
||||||
|
this.createBuffer(netID, target);
|
||||||
|
this.switchBuffer({ network: netID, name: target });
|
||||||
}
|
}
|
||||||
this.createBuffer(netID, target);
|
|
||||||
this.switchBuffer({ network: netID, name: target });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(id) {
|
close(id) {
|
||||||
@@ -1084,6 +1085,7 @@ export default class App extends Component {
|
|||||||
handleJoinSubmit(data) {
|
handleJoinSubmit(data) {
|
||||||
var client = this.clients.get(this.state.joinDialog.network);
|
var client = this.clients.get(this.state.joinDialog.network);
|
||||||
|
|
||||||
|
this.switchToChannel = data.channel;
|
||||||
client.send({ command: "JOIN", params: [data.channel] });
|
client.send({ command: "JOIN", params: [data.channel] });
|
||||||
|
|
||||||
this.setState({ dialog: null, joinDialog: null });
|
this.setState({ dialog: null, joinDialog: null });
|
||||||
|
|||||||
Reference in New Issue
Block a user