further chan fixes

This commit is contained in:
Reto Brunner 2024-03-03 11:33:40 +01:00
parent 3217536245
commit e57e547b74
9 changed files with 25 additions and 13 deletions

View file

@ -2,10 +2,10 @@ import {defineComponent} from "vue";
import {SharedChan} from "../../shared/types/chan";
import {SharedNetwork} from "../../shared/types/network";
import {SharedUser} from "../../shared/models/user";
import {SharedUser} from "../../shared/types/user";
import {SharedMention} from "../../shared/models/mention";
import {SharedConfiguration, LockedSharedConfiguration} from "../../shared/types/config";
import {LinkPreview} from "../../server/plugins/irc-events/link";
import {LinkPreview} from "../../shared/types/msg";
interface LoungeWindow extends Window {
g_TheLoungeRemoveLoading?: () => void;

View file

@ -133,6 +133,7 @@ const input: PluginInputHandler = function (network, chan, cmd, args) {
client.emit("join", {
network: network.uuid,
chan: newChan.getFilteredClone(true),
shouldOpen: false,
index: network.addChannel(newChan),
});
} else {

View file

@ -19,6 +19,7 @@ export default <IrcEventHandler>function (irc, network) {
client.emit("join", {
network: network.uuid,
chan: chan.getFilteredClone(true),
shouldOpen: false,
index: network.addChannel(chan),
});
client.save();

View file

@ -51,6 +51,7 @@ export default <IrcEventHandler>function (irc, network) {
client.emit("join", {
network: network.uuid,
chan: chan.getFilteredClone(true),
shouldOpen: false,
index: network.addChannel(chan),
});
} else {

View file

@ -107,6 +107,7 @@ export default <IrcEventHandler>function (irc, network) {
client.emit("join", {
network: network.uuid,
chan: chan.getFilteredClone(true),
shouldOpen: false,
index: network.addChannel(chan),
});
client.save();

View file

@ -69,6 +69,7 @@ export default <IrcEventHandler>function (irc, network) {
client.emit("join", {
network: network.uuid,
chan: chan.getFilteredClone(true),
shouldOpen: false,
index: network.addChannel(chan),
});
} else {

View file

@ -29,9 +29,9 @@ export default <IrcEventHandler>function (irc, network) {
});
client.emit("join", {
shouldOpen: true,
network: network.uuid,
chan: chan.getFilteredClone(true),
shouldOpen: true,
index: network.addChannel(chan),
});
chan.loadMessages(client, network);

View file

@ -1,5 +1,6 @@
import {SharedMsg} from "./msg";
import {SharedUser} from "./user";
import {SharedNetworkChan} from "./network";
export enum ChanType {
CHANNEL = "channel",
@ -41,3 +42,10 @@ export type SharedChan = {
closed?: boolean;
num_users?: number;
};
export type InitClientChan = {
network: string;
chan: SharedNetworkChan;
shouldOpen: boolean;
index: number;
};

View file

@ -1,11 +1,10 @@
import {ClientNetwork, InitClientChan} from "../../client/js/types";
import {SharedMention} from "../../shared/types/mention";
import {ChanState} from "../../shared/types/chan";
import {SharedMsg, ClientMessage} from "../../shared/types/msg";
import {SharedUser} from "../../shared/types/user";
import {SharedChangelogData} from "../../shared/types/changelog";
import {LinkPreview} from "../plugins/irc-events/link";
import {SharedConfiguration, LockedSharedConfiguration} from "../../shared/types/config";
import {SharedMention} from "./mention";
import {ChanState, InitClientChan} from "./chan";
import {SharedNetwork} from "./network";
import {SharedMsg, ClientMessage, LinkPreview} from "./msg";
import {SharedUser} from "./user";
import {SharedChangelogData} from "./changelog";
import {SharedConfiguration, LockedSharedConfiguration} from "./config";
type Session = {
current: boolean;
@ -50,7 +49,7 @@ interface ServerToClientEvents {
names: (data: {id: number; users: SharedUser[]}) => void;
network: (data: {networks: ClientNetwork[]}) => void;
network: (data: {networks: SharedNetwork[]}) => void;
"network:options": (data: {network: string; serverOptions: {[key: string]: any}}) => void;
"network:status": (data: {network: string; connected: boolean; secure: boolean}) => void;
"network:info": (data: {uuid: string}) => void;
@ -102,7 +101,7 @@ interface ServerToClientEvents {
token,
}: {
active: number;
networks: ClientNetwork[];
networks: SharedNetwork[];
token: string;
}) => void;