(wip): migrate ttp to mtp
Some checks failed
/ build-web (push) Failing after 3m4s
/ build-desktop (linux) (push) Failing after 3m15s
/ build-mobile (push) Failing after 9m7s
/ release (push) Has been skipped

This commit is contained in:
Alois 2026-07-02 21:05:50 +02:00
commit 20018f09a9
163 changed files with 8342 additions and 2609 deletions

View file

@ -22,7 +22,7 @@
"@tensamin/crypto": "workspace:*",
"@tensamin/shared": "workspace:*",
"@tensamin/storage": "workspace:*",
"@tensamin/ttp": "workspace:*",
"@tensamin/mtp": "workspace:*",
"@tensamin/ui": "*",
"@tensamin/user": "workspace:*",
"deepfilternet3-noise-filter": "^1.2.1",

View file

@ -1,9 +1,9 @@
import { useCallback, useEffect, useMemo, useRef } from "react";
import { create } from "zustand";
import { useLocation, useNavigate } from "@tanstack/react-router";
import { useTTP } from "@tensamin/ttp";
import { useMTP } from "@tensamin/mtp";
import { log, toast } from "@tensamin/shared/log";
import { ttp } from "@tensamin/shared/data";
import { mtp } from "@tensamin/shared/data";
import { useCrypto } from "@tensamin/crypto/context";
import { useStorage } from "@tensamin/storage/context";
import { useSession } from "@tensamin/storage/session";
@ -52,7 +52,7 @@ type IncomingCallInvite = {
senderId: number;
};
type CurrentCallData =
| (z.infer<typeof ttp.call_data.response> & { exists: boolean })
| (z.infer<typeof mtp.call_data.response> & { exists: boolean })
| null;
type NavigateFn = (options: {
@ -1088,7 +1088,7 @@ export const useCall = create<CallStore>(() => ({
export function useInitializeCall() {
const navigate = useNavigate();
const location = useLocation();
const { send, subscribePush } = useTTP();
const { send, subscribePush } = useMTP();
const { getSharedSecret, decryptText, encryptText } = useCrypto();
const { load } = useStorage();
const { insertCall } = useSession();
@ -1504,7 +1504,7 @@ export function useInitializeCall() {
send("call_data", { call_id: callId })
.then((data) => {
setCurrentCallData({
...(data.data as z.infer<typeof ttp.call_data.response>),
...(data.data as z.infer<typeof mtp.call_data.response>),
exists: true,
});
})