Skip to content

Commit

Permalink
Merge branch 'frameworkInternals'
Browse files Browse the repository at this point in the history
  • Loading branch information
brunnre8 committed Jun 24, 2023
2 parents 355c5d6 + 7f6059d commit 14575c9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions server/models/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,8 @@ class Network {
}

if (this.irc) {
const connected = this.irc.connection && this.irc.connection.connected;

if (this.nick !== oldNick) {
if (connected) {
if (this.irc.connected) {
// Send new nick straight away
this.irc.changeNick(this.nick);
} else {
Expand All @@ -459,7 +457,7 @@ class Network {
}

if (
connected &&
this.irc.connected &&
this.realname !== oldRealname &&
this.irc.network.cap.isEnabled("setname")
) {
Expand Down
2 changes: 1 addition & 1 deletion server/plugins/inputs/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const input: PluginInputHandler = function (network, chan, cmd, args) {
return;
}

if (irc.connection && irc.connection.connected) {
if (irc.connected) {
chan.pushMessage(
this,
new Msg({
Expand Down
2 changes: 1 addition & 1 deletion server/plugins/inputs/nick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const input: PluginInputHandler = function (network, chan, cmd, args) {
// If connected to IRC, send to server and wait for ACK
// otherwise update the nick and UI straight away
if (network.irc) {
if (network.irc.connection && network.irc.connection.connected) {
if (network.irc.connected) {
network.irc.changeNick(newNick);

return;
Expand Down
4 changes: 1 addition & 3 deletions server/plugins/inputs/part.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ const input: PluginInputHandler = function (network, chan, cmd, args) {
if (
target.type !== ChanType.CHANNEL ||
target.state === ChanState.PARTED ||
!network.irc ||
!network.irc.connection ||
!network.irc.connection.connected
!network.irc.connected
) {
this.part(network, target);
} else {
Expand Down
2 changes: 1 addition & 1 deletion server/plugins/inputs/raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const commands = ["raw", "send", "quote"];

const input: PluginInputHandler = function ({irc}, chan, cmd, args) {
if (args.length !== 0) {
irc.connection.write(args.join(" "));
irc.raw(...args);
}

return true;
Expand Down

0 comments on commit 14575c9

Please sign in to comment.