mirror of
https://github.com/thelounge/thelounge
synced 2024-11-25 13:30:21 +00:00
wip sharedmsg in client
This commit is contained in:
parent
68ba13ca12
commit
b67e4699f5
2 changed files with 6 additions and 6 deletions
|
@ -79,7 +79,7 @@ import {
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import {useStore} from "../js/store";
|
import {useStore} from "../js/store";
|
||||||
import {ClientChan, ClientMessage, ClientNetwork, ClientLinkPreview} from "../js/types";
|
import {ClientChan, ClientMessage, ClientNetwork, ClientLinkPreview} from "../js/types";
|
||||||
import Msg from "../../server/models/msg";
|
import {SharedMsg} from "../../shared/types/msg";
|
||||||
|
|
||||||
type CondensedMessageContainer = {
|
type CondensedMessageContainer = {
|
||||||
type: "condensed";
|
type: "condensed";
|
||||||
|
@ -242,7 +242,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
|
|
||||||
const shouldDisplayDateMarker = (
|
const shouldDisplayDateMarker = (
|
||||||
message: Msg | ClientMessage | CondensedMessageContainer,
|
message: SharedMsg | ClientMessage | CondensedMessageContainer,
|
||||||
id: number
|
id: number
|
||||||
) => {
|
) => {
|
||||||
const previousMessage = condensedMessages.value[id - 1];
|
const previousMessage = condensedMessages.value[id - 1];
|
||||||
|
@ -270,7 +270,7 @@ export default defineComponent({
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isPreviousSource = (currentMessage: ClientMessage | Msg, id: number) => {
|
const isPreviousSource = (currentMessage: ClientMessage | SharedMsg, id: number) => {
|
||||||
const previousMessage = condensedMessages.value[id - 1];
|
const previousMessage = condensedMessages.value[id - 1];
|
||||||
return !!(
|
return !!(
|
||||||
previousMessage &&
|
previousMessage &&
|
||||||
|
|
6
client/js/types.d.ts
vendored
6
client/js/types.d.ts
vendored
|
@ -3,7 +3,7 @@ import {defineComponent} from "vue";
|
||||||
import Chan from "../../server/models/chan";
|
import Chan from "../../server/models/chan";
|
||||||
import Network from "../../server/models/network";
|
import Network from "../../server/models/network";
|
||||||
import User from "../../server/models/user";
|
import User from "../../server/models/user";
|
||||||
import Message from "../../server/models/msg";
|
import SharedMessage from "../../shared/types/msg";
|
||||||
import {Mention} from "../../server/client";
|
import {Mention} from "../../server/client";
|
||||||
import {ClientConfiguration} from "../../server/server";
|
import {ClientConfiguration} from "../../server/server";
|
||||||
import {LinkPreview} from "../../server/plugins/irc-events/link";
|
import {LinkPreview} from "../../server/plugins/irc-events/link";
|
||||||
|
@ -20,8 +20,8 @@ type ClientUser = User & {
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
type ClientMessage = Omit<Message, "users"> & {
|
type ClientMessage = Omit<SharedMessage, "users"> & {
|
||||||
time: number;
|
time: Date;
|
||||||
users: string[];
|
users: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue