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 {SharedChan} from "../../shared/types/chan";
import {SharedNetwork} from "../../shared/types/network"; 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 {SharedMention} from "../../shared/models/mention";
import {SharedConfiguration, LockedSharedConfiguration} from "../../shared/types/config"; 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 { interface LoungeWindow extends Window {
g_TheLoungeRemoveLoading?: () => void; g_TheLoungeRemoveLoading?: () => void;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,6 @@
import {SharedMsg} from "./msg"; import {SharedMsg} from "./msg";
import {SharedUser} from "./user"; import {SharedUser} from "./user";
import {SharedNetworkChan} from "./network";
export enum ChanType { export enum ChanType {
CHANNEL = "channel", CHANNEL = "channel",
@ -41,3 +42,10 @@ export type SharedChan = {
closed?: boolean; closed?: boolean;
num_users?: number; 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 "./mention";
import {SharedMention} from "../../shared/types/mention"; import {ChanState, InitClientChan} from "./chan";
import {ChanState} from "../../shared/types/chan"; import {SharedNetwork} from "./network";
import {SharedMsg, ClientMessage} from "../../shared/types/msg"; import {SharedMsg, ClientMessage, LinkPreview} from "./msg";
import {SharedUser} from "../../shared/types/user"; import {SharedUser} from "./user";
import {SharedChangelogData} from "../../shared/types/changelog"; import {SharedChangelogData} from "./changelog";
import {LinkPreview} from "../plugins/irc-events/link"; import {SharedConfiguration, LockedSharedConfiguration} from "./config";
import {SharedConfiguration, LockedSharedConfiguration} from "../../shared/types/config";
type Session = { type Session = {
current: boolean; current: boolean;
@ -50,7 +49,7 @@ interface ServerToClientEvents {
names: (data: {id: number; users: SharedUser[]}) => void; 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:options": (data: {network: string; serverOptions: {[key: string]: any}}) => void;
"network:status": (data: {network: string; connected: boolean; secure: boolean}) => void; "network:status": (data: {network: string; connected: boolean; secure: boolean}) => void;
"network:info": (data: {uuid: string}) => void; "network:info": (data: {uuid: string}) => void;
@ -102,7 +101,7 @@ interface ServerToClientEvents {
token, token,
}: { }: {
active: number; active: number;
networks: ClientNetwork[]; networks: SharedNetwork[];
token: string; token: string;
}) => void; }) => void;