(feat): migrate ttp to mtp
Some checks failed
/ build-desktop (linux) (push) Failing after 3m58s
/ build-web (push) Failing after 4m13s
/ build-mobile (push) Failing after 6m34s
/ release (push) Has been skipped

(wip): crypto migration
This commit is contained in:
Alois 2026-07-05 01:43:06 +02:00
commit 930663d495
30 changed files with 559 additions and 749 deletions

View file

@ -78,7 +78,7 @@ export default function InviteButton({
});
}}
>
{user.display}
{user.Display}
</Button>
)}
/>

View file

@ -28,12 +28,12 @@ export default function InvitePopup({
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent className="flex flex-col gap-5 items-center justify-center w-65 h-80">
<Avatar className="size-30">
<AvatarImage src={user.avatar} />
<AvatarImage src={user.Avatar} />
<AvatarFallback className="text-5xl">
{user.display.slice(0, 2).toUpperCase()}
{user.Display.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<p className="text-xl font-medium">{user.display}</p>
<p className="text-xl font-medium">{user.Display}</p>
<div className="w-full flex justify-center gap-3">
<Button
className="w-14 h-14"

View file

@ -145,7 +145,7 @@ function Overlay({
</TransparentButton>
)}
<TransparentButton>
<p className="text-sm">{user.display}</p>
<p className="text-sm">{user.Display}</p>
</TransparentButton>
</div>
);
@ -209,14 +209,14 @@ export default function Base({
}, [participant, get]);
useEffect(() => {
if (type !== "user" || !user?.avatar) {
if (type !== "user" || !user?.Avatar) {
setAvatarBackgroundColor(undefined);
return;
}
let active = true;
void getAverageImageColor(user.avatar).then((color) => {
void getAverageImageColor(user.Avatar).then((color) => {
if (active) {
setAvatarBackgroundColor(color);
}
@ -225,7 +225,7 @@ export default function Base({
return () => {
active = false;
};
}, [type, user?.avatar]);
}, [type, user?.Avatar]);
// Avatar calc
const currentCard = useRef<HTMLDivElement>(null);
@ -342,13 +342,13 @@ export default function Base({
height: "32cqh",
}}
>
<AvatarImage src={user.avatar} />
<AvatarImage src={user.Avatar} />
<AvatarFallback
style={{
fontSize: "11cqh",
}}
>
{user.display.slice(0, 2).toUpperCase()}
{user.Display.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
)}

View file

@ -75,9 +75,9 @@ export default function TopBar() {
<TooltipTrigger
render={
<Avatar className="size-7">
<AvatarImage src={user.avatar} />
<AvatarImage src={user.Avatar} />
<AvatarFallback className="text-xs">
{user.display.slice(0, 2).toUpperCase()}
{user.Display.slice(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
}
@ -86,7 +86,7 @@ export default function TopBar() {
side="bottom"
portalProps={{ container: portalContainer }}
>
{user.display}
{user.Display}
</TooltipContent>
</Tooltip>
</div>

View file

@ -52,7 +52,7 @@ type IncomingCallInvite = {
senderId: number;
};
type CurrentCallData =
(z.infer<typeof mtp.call_data.response> & { exists: boolean }) | null;
(z.infer<typeof mtp.CallData.response> & { exists: boolean }) | null;
type NavigateFn = (options: {
to: string;
@ -626,7 +626,7 @@ export async function sendCallInvite(userId: number) {
}
const ownUserId = (await runtime.load("user_id")) as number;
const privateKey = await runtime.load("private_key");
const privateKey = await runtime.load("mtp_keyring");
const ownPublicKey = await runtime
.getUser(ownUserId)
.then((data) => data.PublicKey);
@ -897,7 +897,7 @@ export async function joinCall(
if (callSecret) {
try {
const sharedSecret = await runtime.getSharedSecret(
await runtime.load("private_key"),
await runtime.load("mtp_keyring"),
await runtime
.getUser((await runtime.load("user_id")) as number)
.then((res) => res.PublicKey),
@ -1178,7 +1178,7 @@ export function useInitializeCall() {
// listen to call invites
useEffect(() => {
subscribePush(async (message) => {
if (message.type !== "call_invite") return;
if (message.type !== "CallInvite") return;
const { CallId, CallSecret, SenderId } = message.data as {
CallId: string;
@ -1500,10 +1500,10 @@ export function useInitializeCall() {
return;
}
send("call_data", { CallId: callId })
send("CallData", { CallId: callId })
.then((data) => {
setCurrentCallData({
...(data.data as z.infer<typeof mtp.call_data.response>),
...(data.data as z.infer<typeof mtp.CallData.response>),
exists: true,
});
})

View file

@ -45,7 +45,7 @@ export default function Preview() {
{data.map((user) => {
return (
<p key={user.UserId} className="text-2xl">
User: {user.display}
User: {user.Display}
</p>
);
})}