mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Postbox -> TelegramEngine waves 107-137 (squashed)
31 waves of consumer-side migration from `import Postbox` to TelegramEngine typealiases. Net: 173 import drops + 39 BUILD-dep drops + 1 new typealias (`EngineStoryId = StoryId`, wave 113). Wave shapes used: - Orphan-import sweeps (107, 108, 128): drop `import Postbox` from files whose only Postbox-symbol reference was the import line itself, then resolve build failures. Methodology requires token-level (`grep -oE`) filtering, not line-level, to avoid masking real Postbox usage on lines that also contain `Namespaces.X` references. - Identifier-swap mini-waves (109-127, 129-134, 136-137): rename Postbox-typealiased identifiers to engine equivalents (PeerId -> EnginePeer.Id, MessageId -> EngineMessage.Id, MediaId -> EngineMedia.Id, MessageIndex -> EngineMessage.Index, StoryId -> EngineStoryId, ItemCollectionId -> EngineItemCollectionId, PreferencesEntry -> EnginePreferencesEntry, FetchResourceSourceType/Error -> EngineFetchResourceSourceType/Error, MemoryBuffer -> EngineMemoryBuffer, MessageTags -> EngineMessage.Tags, MessageAttribute -> EngineMessage.Attribute, TempBox -> EngineTempBox). - Asset-string FP-only orphans (124). - Typealias addition + drain (113): added `EngineStoryId` typealias to TelegramCore, then drained 3+11 consumer sites. Hard blockers identified during these waves (must restore `import Postbox` when present): MediaResource[A-Za-z]* (any suffix -- the literal `MediaResource` matches don't catch MediaResourceData/MediaResourceId/etc.), Postbox/MediaBox/MediaResource raw types, PostboxCoding/PostboxEncoder/ PostboxDecoder, TempBoxFile, ValueBoxKey, PostboxView, combinedView, HashFunctions, postboxLog, openPostbox, declareEncodable, PeerView, MessageHistoryView, MessageHistoryThreadData, CachedPeerData, RenderedPeer, SelectivePrivacyPeer, SimpleDictionary, ItemCollectionInfosView, ItemCollectionItem, ItemCollectionItemIndex, ItemCollectionViewEntryIndex, ChatListIndex, ChatListEntrySummaryComponents, CodableEntry, MessageHistoryThread, MessageHistoryAnchorIndex, MessageHistoryEntryLocation, PeerStoryStats, PeerNameIndex, PeerSummaryCounterTags, ChatListTotalUnreadStateCategory/Stats, arePeersEqual. Protocol-shape blockers: bare `Peer`/`Message`/`Media` in function signatures, generic args, enum-case payloads, or dict value types (e.g., `[PeerId: Peer]`, `case messages([Message])`, `Signal<(Peer?, ...), NoError>`). `replace_all PeerId -> EnginePeer.Id` is dangerous: mangles compound names like `failedPeerId`, `ContactListPeerId`, `nextRemoteMediaId`, `replyToMessageId`. Pre-flight grep `\b[a-z][a-zA-Z]*PeerId\b` and only replace_all if 0 matches. Also removes unneeded design/plan docs from a separate (link-highlighting) feature branch: - docs/superpowers/plans/2026-05-02-link-highlighting-modern-path-fixes.md - docs/superpowers/specs/2026-05-02-link-highlighting-modern-path-fixes-design.md Squashed commits: 6d82c2980d..e6de5d53a3 (59 commits, including per-wave content commits and per-wave CLAUDE.md bumps). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b1aab0839c
commit
86d1456552
209 changed files with 337 additions and 785 deletions
|
|
@ -41,7 +41,7 @@ A gradual migration is underway to eliminate direct `import Postbox` from consum
|
||||||
|
|
||||||
**Historical record:** Wave-by-wave outcomes, the running tally of Postbox-free modules, and full verbose forms of the guidance subsections below live in [`docs/superpowers/postbox-refactor-log.md`](docs/superpowers/postbox-refactor-log.md). Read that file when you need wave-specific context, a full worked example of a pattern, or the history of a particular module's migration.
|
**Historical record:** Wave-by-wave outcomes, the running tally of Postbox-free modules, and full verbose forms of the guidance subsections below live in [`docs/superpowers/postbox-refactor-log.md`](docs/superpowers/postbox-refactor-log.md). Read that file when you need wave-specific context, a full worked example of a pattern, or the history of a particular module's migration.
|
||||||
|
|
||||||
Waves landed so far (as of 2026-04-24): 45 waves plus standalone cleanups. See the log file for per-wave detail; the list of still-open migration opportunities lives in the `project_postbox_refactor_next_wave.md` memory file.
|
Waves landed so far (as of 2026-05-02): 137 waves plus standalone cleanups. See the log file for per-wave detail; the list of still-open migration opportunities lives in the `project_postbox_refactor_next_wave.md` memory file.
|
||||||
|
|
||||||
### Rules that apply to every wave
|
### Rules that apply to every wave
|
||||||
|
|
||||||
|
|
@ -74,6 +74,7 @@ AdaptedPostboxDecoder → EngineAdaptedPostboxDecoder (added 2026-04)
|
||||||
ItemCollectionId → EngineItemCollectionId (added 2026-04-20)
|
ItemCollectionId → EngineItemCollectionId (added 2026-04-20)
|
||||||
FetchResourceSourceType → EngineFetchResourceSourceType (added 2026-04-20)
|
FetchResourceSourceType → EngineFetchResourceSourceType (added 2026-04-20)
|
||||||
FetchResourceError → EngineFetchResourceError (added 2026-04-20)
|
FetchResourceError → EngineFetchResourceError (added 2026-04-20)
|
||||||
|
StoryId → EngineStoryId (added 2026-05-02)
|
||||||
```
|
```
|
||||||
|
|
||||||
For the `MediaResource` Postbox protocol, prefer the TelegramCore subtype `TelegramMediaResource` when the consumer's usage allows (note: `EngineMediaResource` is a wrapper **class**, not a typealias, so it is not interchangeable with the protocol).
|
For the `MediaResource` Postbox protocol, prefer the TelegramCore subtype `TelegramMediaResource` when the consumer's usage allows (note: `EngineMediaResource` is a wrapper **class**, not a typealias, so it is not interchangeable with the protocol).
|
||||||
|
|
|
||||||
|
|
@ -1,217 +0,0 @@
|
||||||
# Modern Path Link-Highlighting Fixes Implementation Plan
|
|
||||||
|
|
||||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
||||||
|
|
||||||
**Goal:** Fix two correctness bugs in `LinkHighlightingNode`'s modern path branch — issue #3 (X-edge snap unreachable after midY snap) and issue #7 (zero-radius arcs from `floor` rounding).
|
|
||||||
|
|
||||||
**Architecture:** Two single-token edits in `submodules/Display/Source/LinkHighlightingNode.swift`, each landed as its own commit. Final validation by full project build (no unit tests in this repo per CLAUDE.md).
|
|
||||||
|
|
||||||
**Tech Stack:** Swift, Bazel via `Make.py`, iOS simulator (`debug_sim_arm64`).
|
|
||||||
|
|
||||||
**Spec:** `docs/superpowers/specs/2026-05-02-link-highlighting-modern-path-fixes-design.md`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## File map
|
|
||||||
|
|
||||||
- Modify: `submodules/Display/Source/LinkHighlightingNode.swift` — two single-line edits inside the `useModernPathCalculation` branch of `drawRectsImageContent`. No new files, no signature changes, no callers affected.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 1: Fix issue #3 — X-edge snap inset direction
|
|
||||||
|
|
||||||
The X-snap guard currently uses `insetBy(dx: 0.0, dy: 1.0)`, which *shrinks* `rects[i]` by 1 px on each Y edge. After the preceding midY snap, `rects[i].maxY == rects[i+1].minY`; shrinking then makes them not intersect (`CGRect.intersects` requires positive-area overlap), so the guard is unreachable for the canonical multi-line link case. The fix is to flip the direction so the rect *grows*, producing the 1-px overlap the guard needs.
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Modify: `submodules/Display/Source/LinkHighlightingNode.swift:85`
|
|
||||||
|
|
||||||
- [ ] **Step 1: Inspect the target line**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
sed -n '85p' submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected:
|
|
||||||
```
|
|
||||||
if rects[i].maxY >= rects[i + 1].minY && rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i + 1]) {
|
|
||||||
```
|
|
||||||
|
|
||||||
If the line content differs, stop and re-read the file — line numbers may have shifted.
|
|
||||||
|
|
||||||
- [ ] **Step 2: Apply the edit**
|
|
||||||
|
|
||||||
In `submodules/Display/Source/LinkHighlightingNode.swift`, replace the X-snap guard with a negative-dy inset so the temp rect grows by 1 px on each Y edge:
|
|
||||||
|
|
||||||
```swift
|
|
||||||
if rects[i].maxY >= rects[i + 1].minY && rects[i].insetBy(dx: 0.0, dy: -1.0).intersects(rects[i + 1]) {
|
|
||||||
```
|
|
||||||
|
|
||||||
The change is a single character: `dy: 1.0` → `dy: -1.0`. No other lines change.
|
|
||||||
|
|
||||||
- [ ] **Step 3: Verify the change**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
sed -n '85p' submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected:
|
|
||||||
```
|
|
||||||
if rects[i].maxY >= rects[i + 1].minY && rects[i].insetBy(dx: 0.0, dy: -1.0).intersects(rects[i + 1]) {
|
|
||||||
```
|
|
||||||
|
|
||||||
- [ ] **Step 4: Commit**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git add submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
git commit -m "$(cat <<'EOF'
|
|
||||||
LinkHighlightingNode: fix X-edge snap unreachable after midY snap
|
|
||||||
|
|
||||||
In drawRectsImageContent's modern path the snap loop runs midY
|
|
||||||
trimming first, leaving rects[i].maxY == rects[i+1].minY for
|
|
||||||
adjacent line rects. The X-edge snap guard then evaluated
|
|
||||||
rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i+1]) — but
|
|
||||||
positive dy shrinks the rect, so after the trim the guarded
|
|
||||||
rectangle no longer intersects its neighbor (CGRect.intersects
|
|
||||||
requires positive-area overlap). Flip dy to -1.0 so the temp
|
|
||||||
rect grows and touching neighbors satisfy the guard.
|
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||||||
EOF
|
|
||||||
)"
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 2: Fix issue #7 — replace `floor` with `ceil` in nextRadius/prevRadius
|
|
||||||
|
|
||||||
`nextRadius` (line 127) and `prevRadius` (line 154) compute the corner-fillet radius for stair-step joins between adjacent line rects: `min(outerRadius, floor(abs(...) * 0.5))`. When `|Δx| < 2`, `floor` produces 0 and the subsequent `addArc(... radius: 0)` is a no-op (the corner stays unsmoothed). After Task 1's fix, the X-snap will catch most `|Δx| < 2` cases — but residual fractional-pixel deltas can still hit floor=0. Switching to `ceil` clamps any non-zero gap up to ≥ 1 px, which is what the corner needs visually. Subpixel `Δx == 0` is not affected because the `else` branch at lines 124 and 151 handles exact equality with a straight `addLine`.
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Modify: `submodules/Display/Source/LinkHighlightingNode.swift:127`
|
|
||||||
- Modify: `submodules/Display/Source/LinkHighlightingNode.swift:154`
|
|
||||||
|
|
||||||
- [ ] **Step 1: Inspect both target lines**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
sed -n '127p;154p' submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected:
|
|
||||||
```
|
|
||||||
let nextRadius = min(outerRadius, floor(abs(rect.maxX - next.maxX) * 0.5))
|
|
||||||
let prevRadius = min(outerRadius, floor(abs(rect.minX - prev.minX) * 0.5))
|
|
||||||
```
|
|
||||||
|
|
||||||
If either line content differs, stop and re-read the file.
|
|
||||||
|
|
||||||
- [ ] **Step 2: Apply edit on line 127**
|
|
||||||
|
|
||||||
In `submodules/Display/Source/LinkHighlightingNode.swift`, change:
|
|
||||||
```swift
|
|
||||||
let nextRadius = min(outerRadius, floor(abs(rect.maxX - next.maxX) * 0.5))
|
|
||||||
```
|
|
||||||
to:
|
|
||||||
```swift
|
|
||||||
let nextRadius = min(outerRadius, ceil(abs(rect.maxX - next.maxX) * 0.5))
|
|
||||||
```
|
|
||||||
|
|
||||||
- [ ] **Step 3: Apply edit on line 154**
|
|
||||||
|
|
||||||
In the same file, change:
|
|
||||||
```swift
|
|
||||||
let prevRadius = min(outerRadius, floor(abs(rect.minX - prev.minX) * 0.5))
|
|
||||||
```
|
|
||||||
to:
|
|
||||||
```swift
|
|
||||||
let prevRadius = min(outerRadius, ceil(abs(rect.minX - prev.minX) * 0.5))
|
|
||||||
```
|
|
||||||
|
|
||||||
- [ ] **Step 4: Verify both changes**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
sed -n '127p;154p' submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected:
|
|
||||||
```
|
|
||||||
let nextRadius = min(outerRadius, ceil(abs(rect.maxX - next.maxX) * 0.5))
|
|
||||||
let prevRadius = min(outerRadius, ceil(abs(rect.minX - prev.minX) * 0.5))
|
|
||||||
```
|
|
||||||
|
|
||||||
- [ ] **Step 5: Confirm no other `floor(abs(` patterns remain in the modern branch**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
grep -n "floor(abs(" submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected: no matches (the only remaining `floor` should be on line 79, the midY snap, which is intentional).
|
|
||||||
|
|
||||||
- [ ] **Step 6: Commit**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git add submodules/Display/Source/LinkHighlightingNode.swift
|
|
||||||
git commit -m "$(cat <<'EOF'
|
|
||||||
LinkHighlightingNode: ceil instead of floor for stair-step radii
|
|
||||||
|
|
||||||
drawRectsImageContent's modern path computed nextRadius and
|
|
||||||
prevRadius as min(outerRadius, floor(|Δx| * 0.5)). When |Δx| < 2
|
|
||||||
the floor produces 0 and the addArc call becomes a no-op,
|
|
||||||
leaving an unsmoothed corner at the stair-step. Replace floor
|
|
||||||
with ceil so any non-zero edge mismatch rounds up to at least
|
|
||||||
1 px. Exact-equality cases (Δx == 0) are unaffected — they take
|
|
||||||
the else branch with a straight addLine.
|
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||||||
EOF
|
|
||||||
)"
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 3: Validate with full project build
|
|
||||||
|
|
||||||
The Display module (and most of the chat UI submodules) depend on `LinkHighlightingNode.swift`, so a clean build of the umbrella `Telegram/Telegram` target validates that the edits are syntactically and semantically valid. There are no unit tests in this repo. CLAUDE.md notes that `TELEGRAM_CODESIGNING_GIT_PASSWORD` lives in `~/.zshrc` and must be sourced explicitly because Bash here doesn't read shell config.
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- None (build-only validation).
|
|
||||||
|
|
||||||
- [ ] **Step 1: Run full project build**
|
|
||||||
|
|
||||||
Run from the repo root:
|
|
||||||
```bash
|
|
||||||
source ~/.zshrc 2>/dev/null; python3 build-system/Make/Make.py --overrideXcodeVersion \
|
|
||||||
--cacheDir ~/telegram-bazel-cache \
|
|
||||||
build \
|
|
||||||
--configurationPath build-system/appstore-configuration.json \
|
|
||||||
--gitCodesigningRepository git@gitlab.com:peter-iakovlev/fastlanematch.git \
|
|
||||||
--gitCodesigningType development --gitCodesigningUseCurrent --buildNumber=1 --configuration=debug_sim_arm64
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected: build succeeds (exit code 0). The build is multi-minute; tail the output and confirm completion.
|
|
||||||
|
|
||||||
- [ ] **Step 2: If build fails**
|
|
||||||
|
|
||||||
If the build fails on `LinkHighlightingNode.swift`:
|
|
||||||
- A failure on line 85 means the inset edit was malformed — re-check the syntax.
|
|
||||||
- A failure on lines 127 or 154 means the `floor → ceil` swap introduced a typo.
|
|
||||||
- A failure elsewhere is unrelated to these edits — investigate before continuing.
|
|
||||||
|
|
||||||
If the failure is on `LinkHighlightingNode.swift`, revert the failing commit (`git reset --hard HEAD~1`), re-apply the edit using the `Edit` tool with exact matching strings, and rerun the build.
|
|
||||||
|
|
||||||
- [ ] **Step 3: Visual check (manual, optional)**
|
|
||||||
|
|
||||||
If the simulator is launched, send a chat message with a long URL that wraps across multiple lines and tap-and-hold to invoke the link highlight. The stair-step joins between line rects should now show smooth fillets where adjacent X edges differ by less than 2 px (previously unsmoothed). This step is informational — the build success is the gating signal for the plan.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Self-Review
|
|
||||||
|
|
||||||
- **Spec coverage:** Issue #3 → Task 1. Issue #7 → Task 2. Validation paragraph → Task 3. Out-of-scope items (#1, #2, #5, #6, #8) explicitly excluded — covered by spec, not by tasks.
|
|
||||||
- **Placeholder scan:** No "TBD" / "TODO" / "similar to" / vague-error-handling. All edits show exact before/after code.
|
|
||||||
- **Type consistency:** No new symbols introduced; existing `outerRadius`, `nextRadius`, `prevRadius`, `rects[i]`, `CGRect.insetBy(dx:dy:)`, `CGRect.intersects(_:)` all already in scope at the edit sites.
|
|
||||||
- **Line-number drift:** Each edit task starts with a `sed -n` inspection that bails out if the line content differs from the expected string — protects against drift if the file is touched between plan-write and plan-execute.
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
# Modern path calculation fixes — issues #3 and #7
|
|
||||||
|
|
||||||
`submodules/Display/Source/LinkHighlightingNode.swift`, in the `useModernPathCalculation` branch of `drawRectsImageContent`.
|
|
||||||
|
|
||||||
## Issue #3 — X-edge snap never fires after the midY snap
|
|
||||||
|
|
||||||
The snap loop at lines 75–113 has two passes per `i`:
|
|
||||||
1. midY snap (lines 78–84) — splits any vertically-overlapping rects at `midY`, leaving `rects[i].maxY == rects[i+1].minY`.
|
|
||||||
2. X-edge snap (lines 85–108) — guards on `rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i+1])`. With positive `dy`, this *shrinks* `rects[i]`, so after the midY snap they no longer intersect — the guard is unreachable for the canonical multi-line link case.
|
|
||||||
|
|
||||||
**Fix:** flip the inset to `dy: -1.0` so the guard *grows* `rects[i]` by 1 px on each Y edge. After the midY snap the touching edges are at the same y; growing rect[i] by 1 makes it overlap rect[i+1] by 1 px, satisfying `CGRect.intersects` (which requires positive-area intersection). The X-snap then runs on every adjacent pair the algorithm intended to handle.
|
|
||||||
|
|
||||||
Why `-1.0` and not `0.0`: `CGRect.intersects` returns `false` for shared-edge-only contact, so a non-zero grow is required.
|
|
||||||
|
|
||||||
## Issue #7 — `nextRadius`/`prevRadius` can be 0 when X edges differ by less than 2 px
|
|
||||||
|
|
||||||
Line 127: `nextRadius = min(outerRadius, floor(abs(rect.maxX - next.maxX) * 0.5))`. When `|Δx| < 2`, `floor` produces 0 and the call to `addArc` is a no-op (the corner stays unsmoothed). Same pattern at line 154 for `prevRadius` on the left edge.
|
|
||||||
|
|
||||||
**Fix:** replace `floor` with `ceil`, and keep `min(outerRadius, …)` as the upper bound. With `ceil`, any non-zero gap rounds up to at least 1 px, which is what the corner needs visually. (Subpixel `Δx == 0` is the "edges already aligned" case and the unmodified `else` branch above each conditional already handles it with a straight `addLine`.)
|
|
||||||
|
|
||||||
After fixing #3, the typical multi-line case should snap edges to common min/max when `|Δx| < minRadius (= 2.0)`, so #7 mostly handles the residual fractional-pixel case post-snap and any case where `|Δx| ≥ minRadius` but the floor would still drop to 0 (only possible at exactly `|Δx| = 2`, where `floor(1.0) = 1` is already fine — so #7 primarily covers `|Δx|` in `(0, 2)` *not* caught by snap, e.g., when `minX` and `maxX` deltas have different sub-pixel splits across an adjacent pair).
|
|
||||||
|
|
||||||
## Out of scope
|
|
||||||
|
|
||||||
- Issue #1 (single-rect path ignores `inset`) — separate change.
|
|
||||||
- Issues #2, #4 (innerRadius, dy direction in the *same* line as #3 — note: #3's fix IS the dy direction change, so #4 is subsumed), #5 (no closePath), #6 (.copy blend mode), #8 (snap loop bound).
|
|
||||||
|
|
||||||
## Validation
|
|
||||||
|
|
||||||
No tests exist in this repo (per CLAUDE.md). Validation is by full project build (`Make.py … --configuration=debug_sim_arm64`) and visual inspection of multi-line link highlights in chat — exercised by the change just made to `ChatMessageRichDataBubbleContentNode` (which now sets `useModernPathCalculation = true`).
|
|
||||||
|
|
||||||
## Risk
|
|
||||||
|
|
||||||
`drawRectsImageContent`'s modern branch is reachable from many call sites (`ChatMessageUnlockMediaNode`, `ChatEmptyNode`, `ShimmeringLinkNode`, `ChatListItem`, `TextLoadingEffect` once it's uncommented, etc.). The fix only changes how multi-rect highlights look — single-rect is untouched. Typical visual change: cleaner stair-step joins between adjacent line rects with near-aligned X edges.
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
||||||
|
|
@ -47,7 +46,7 @@ public struct ContactListAdditionalOption: Equatable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ContactListPeerId: Hashable {
|
public enum ContactListPeerId: Hashable {
|
||||||
case peer(PeerId)
|
case peer(EnginePeer.Id)
|
||||||
case deviceContact(DeviceContactStableId)
|
case deviceContact(DeviceContactStableId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import LegacyComponents
|
||||||
import ProgressNavigationButtonNode
|
import ProgressNavigationButtonNode
|
||||||
import ImageCompression
|
import ImageCompression
|
||||||
import LegacyMediaPickerUI
|
import LegacyMediaPickerUI
|
||||||
import Postbox
|
|
||||||
import TextFormat
|
import TextFormat
|
||||||
import MoreButtonNode
|
import MoreButtonNode
|
||||||
import ContextUI
|
import ContextUI
|
||||||
|
|
@ -272,9 +271,9 @@ final class AuthorizationSequenceSignUpController: ViewController {
|
||||||
|
|
||||||
if let name = name {
|
if let name = name {
|
||||||
self.signUpWithName?(name.0, name.1, self.controllerNode.currentPhoto.flatMap({ image in
|
self.signUpWithName?(name.0, name.1, self.controllerNode.currentPhoto.flatMap({ image in
|
||||||
let tempFile = TempBox.shared.tempFile(fileName: "file")
|
let tempFile = EngineTempBox.shared.tempFile(fileName: "file")
|
||||||
let result = compressImageToJPEG(image, quality: 0.7, tempFilePath: tempFile.path)
|
let result = compressImageToJPEG(image, quality: 0.7, tempFilePath: tempFile.path)
|
||||||
TempBox.shared.dispose(tempFile)
|
EngineTempBox.shared.dispose(tempFile)
|
||||||
return result
|
return result
|
||||||
}), self.avatarAsset, self.avatarAdjustments, self.announceSignUp)
|
}), self.avatarAsset, self.avatarAdjustments, self.announceSignUp)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
|
@ -1583,7 +1582,7 @@ public class BrowserScreen: ViewController, MinimizableController {
|
||||||
case pdfDocument(file: FileMediaReference, canShare: Bool)
|
case pdfDocument(file: FileMediaReference, canShare: Bool)
|
||||||
case markdownDocument(file: FileMediaReference, canShare: Bool)
|
case markdownDocument(file: FileMediaReference, canShare: Bool)
|
||||||
|
|
||||||
public var fileId: MediaId? {
|
public var fileId: EngineMedia.Id? {
|
||||||
switch self {
|
switch self {
|
||||||
case let .document(file, _), let .pdfDocument(file, _), let .markdownDocument(file, _):
|
case let .document(file, _), let .pdfDocument(file, _), let .markdownDocument(file, _):
|
||||||
return file.media.fileId
|
return file.media.fileId
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import SwiftSignalKit
|
||||||
import AnimationCache
|
import AnimationCache
|
||||||
import MultiAnimationRenderer
|
import MultiAnimationRenderer
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import ChatListHeaderComponent
|
import ChatListHeaderComponent
|
||||||
import ActionPanelComponent
|
import ActionPanelComponent
|
||||||
import ChatFolderLinkPreviewScreen
|
import ChatFolderLinkPreviewScreen
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -31,8 +30,8 @@ final class ChatListSearchMessageSelectionPanelNode: ASDisplayNode {
|
||||||
|
|
||||||
private var validLayout: ContainerViewLayout?
|
private var validLayout: ContainerViewLayout?
|
||||||
|
|
||||||
var chatAvailableMessageActions: ((Set<MessageId>) -> Signal<ChatAvailableMessageActions, NoError>)?
|
var chatAvailableMessageActions: ((Set<EngineMessage.Id>) -> Signal<ChatAvailableMessageActions, NoError>)?
|
||||||
var selectedMessages = Set<MessageId>() {
|
var selectedMessages = Set<EngineMessage.Id>() {
|
||||||
didSet {
|
didSet {
|
||||||
if oldValue != self.selectedMessages {
|
if oldValue != self.selectedMessages {
|
||||||
self.forwardButton.isEnabled = self.selectedMessages.count != 0
|
self.forwardButton.isEnabled = self.selectedMessages.count != 0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
||||||
|
|
@ -22,27 +21,27 @@ public enum ChatMediaInputGifMode: Equatable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class ChatMediaInputNodeInteraction {
|
public final class ChatMediaInputNodeInteraction {
|
||||||
public let navigateToCollectionId: (ItemCollectionId) -> Void
|
public let navigateToCollectionId: (EngineItemCollectionId) -> Void
|
||||||
public let navigateBackToStickers: () -> Void
|
public let navigateBackToStickers: () -> Void
|
||||||
public let setGifMode: (ChatMediaInputGifMode) -> Void
|
public let setGifMode: (ChatMediaInputGifMode) -> Void
|
||||||
public let openSettings: () -> Void
|
public let openSettings: () -> Void
|
||||||
public let openTrending: (ItemCollectionId?) -> Void
|
public let openTrending: (EngineItemCollectionId?) -> Void
|
||||||
public let dismissTrendingPacks: ([ItemCollectionId]) -> Void
|
public let dismissTrendingPacks: ([EngineItemCollectionId]) -> Void
|
||||||
public let toggleSearch: (Bool, ChatMediaInputSearchMode?, String) -> Void
|
public let toggleSearch: (Bool, ChatMediaInputSearchMode?, String) -> Void
|
||||||
public let openPeerSpecificSettings: () -> Void
|
public let openPeerSpecificSettings: () -> Void
|
||||||
public let dismissPeerSpecificSettings: () -> Void
|
public let dismissPeerSpecificSettings: () -> Void
|
||||||
public let clearRecentlyUsedStickers: () -> Void
|
public let clearRecentlyUsedStickers: () -> Void
|
||||||
|
|
||||||
public var stickerSettings: ChatInterfaceStickerSettings?
|
public var stickerSettings: ChatInterfaceStickerSettings?
|
||||||
public var highlightedStickerItemCollectionId: ItemCollectionId?
|
public var highlightedStickerEngineItemCollectionId: EngineItemCollectionId?
|
||||||
public var highlightedItemCollectionId: ItemCollectionId?
|
public var highlightedEngineItemCollectionId: EngineItemCollectionId?
|
||||||
public var highlightedGifMode: ChatMediaInputGifMode = .recent
|
public var highlightedGifMode: ChatMediaInputGifMode = .recent
|
||||||
public var previewedStickerPackItemFile: TelegramMediaFile?
|
public var previewedStickerPackItemFile: TelegramMediaFile?
|
||||||
public var appearanceTransition: CGFloat = 1.0
|
public var appearanceTransition: CGFloat = 1.0
|
||||||
public var displayStickerPlaceholder = true
|
public var displayStickerPlaceholder = true
|
||||||
public var displayStickerPackManageControls = true
|
public var displayStickerPackManageControls = true
|
||||||
|
|
||||||
public init(navigateToCollectionId: @escaping (ItemCollectionId) -> Void, navigateBackToStickers: @escaping () -> Void, setGifMode: @escaping (ChatMediaInputGifMode) -> Void, openSettings: @escaping () -> Void, openTrending: @escaping (ItemCollectionId?) -> Void, dismissTrendingPacks: @escaping ([ItemCollectionId]) -> Void, toggleSearch: @escaping (Bool, ChatMediaInputSearchMode?, String) -> Void, openPeerSpecificSettings: @escaping () -> Void, dismissPeerSpecificSettings: @escaping () -> Void, clearRecentlyUsedStickers: @escaping () -> Void) {
|
public init(navigateToCollectionId: @escaping (EngineItemCollectionId) -> Void, navigateBackToStickers: @escaping () -> Void, setGifMode: @escaping (ChatMediaInputGifMode) -> Void, openSettings: @escaping () -> Void, openTrending: @escaping (EngineItemCollectionId?) -> Void, dismissTrendingPacks: @escaping ([EngineItemCollectionId]) -> Void, toggleSearch: @escaping (Bool, ChatMediaInputSearchMode?, String) -> Void, openPeerSpecificSettings: @escaping () -> Void, dismissPeerSpecificSettings: @escaping () -> Void, clearRecentlyUsedStickers: @escaping () -> Void) {
|
||||||
self.navigateToCollectionId = navigateToCollectionId
|
self.navigateToCollectionId = navigateToCollectionId
|
||||||
self.navigateBackToStickers = navigateBackToStickers
|
self.navigateBackToStickers = navigateBackToStickers
|
||||||
self.setGifMode = setGifMode
|
self.setGifMode = setGifMode
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
import TelegramCore
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import ComponentDisplayAdapters
|
import ComponentDisplayAdapters
|
||||||
|
|
||||||
|
|
@ -12,11 +12,11 @@ public final class GalleryControllerInteraction {
|
||||||
public let pushController: (ViewController) -> Void
|
public let pushController: (ViewController) -> Void
|
||||||
public let dismissController: () -> Void
|
public let dismissController: () -> Void
|
||||||
public let replaceRootController: (ViewController, Promise<Bool>?) -> Void
|
public let replaceRootController: (ViewController, Promise<Bool>?) -> Void
|
||||||
public let editMedia: (MessageId) -> Void
|
public let editMedia: (EngineMessage.Id) -> Void
|
||||||
public let controller: () -> ViewController?
|
public let controller: () -> ViewController?
|
||||||
public let currentItemNode: () -> GalleryItemNode?
|
public let currentItemNode: () -> GalleryItemNode?
|
||||||
|
|
||||||
public init(presentController: @escaping (ViewController, ViewControllerPresentationArguments?) -> Void, pushController: @escaping (ViewController) -> Void, dismissController: @escaping () -> Void, replaceRootController: @escaping (ViewController, Promise<Bool>?) -> Void, editMedia: @escaping (MessageId) -> Void, controller: @escaping () -> ViewController?, currentItemNode: @escaping () -> GalleryItemNode?) {
|
public init(presentController: @escaping (ViewController, ViewControllerPresentationArguments?) -> Void, pushController: @escaping (ViewController) -> Void, dismissController: @escaping () -> Void, replaceRootController: @escaping (ViewController, Promise<Bool>?) -> Void, editMedia: @escaping (EngineMessage.Id) -> Void, controller: @escaping () -> ViewController?, currentItemNode: @escaping () -> GalleryItemNode?) {
|
||||||
self.presentController = presentController
|
self.presentController = presentController
|
||||||
self.pushController = pushController
|
self.pushController = pushController
|
||||||
self.dismissController = dismissController
|
self.dismissController = dismissController
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
||||||
private struct HashtagSearchRecentQueryItemId {
|
private struct HashtagSearchRecentQueryItemId {
|
||||||
public let rawValue: MemoryBuffer
|
public let rawValue: EngineMemoryBuffer
|
||||||
|
|
||||||
var value: String {
|
var value: String {
|
||||||
return String(data: self.rawValue.makeData(), encoding: .utf8) ?? ""
|
return String(data: self.rawValue.makeData(), encoding: .utf8) ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
init(_ rawValue: MemoryBuffer) {
|
init(_ rawValue: EngineMemoryBuffer) {
|
||||||
self.rawValue = rawValue
|
self.rawValue = rawValue
|
||||||
}
|
}
|
||||||
|
|
||||||
init?(_ value: String) {
|
init?(_ value: String) {
|
||||||
if let data = value.data(using: .utf8) {
|
if let data = value.data(using: .utf8) {
|
||||||
self.rawValue = MemoryBuffer(data: data)
|
self.rawValue = EngineMemoryBuffer(data: data)
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ swift_library(
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/Postbox:Postbox",
|
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
"//submodules/TelegramStringFormatting:TelegramStringFormatting",
|
"//submodules/TelegramStringFormatting:TelegramStringFormatting",
|
||||||
"//submodules/TelegramUIPreferences:TelegramUIPreferences",
|
"//submodules/TelegramUIPreferences:TelegramUIPreferences",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SyncCore
|
import SyncCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
|
|
||||||
func loadLegacyUser(database: SqliteInterface, id: Int32) -> (TelegramUser, TelegramUserPresence)? {
|
func loadLegacyUser(database: SqliteInterface, id: Int32) -> (TelegramUser, TelegramUserPresence)? {
|
||||||
var result: (TelegramUser, TelegramUserPresence)?
|
var result: (TelegramUser, TelegramUserPresence)?
|
||||||
|
|
@ -24,7 +23,7 @@ func loadLegacyUser(database: SqliteInterface, id: Int32) -> (TelegramUser, Tele
|
||||||
photo.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: 600, height: 600), resource: resource, progressiveSizes: []))
|
photo.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: 600, height: 600), resource: resource, progressiveSizes: []))
|
||||||
}
|
}
|
||||||
|
|
||||||
let user = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: cursor.getInt32(at: 0)), accessHash: accessHash == 0 ? nil : .personal(accessHash), firstName: firstName.isEmpty ? nil : firstName, lastName: lastName.isEmpty ? nil : lastName, username: username.isEmpty ? nil : username, phone: phone.isEmpty ? nil : phone, photo: photo, botInfo: nil, restrictionInfo: nil, flags: [])
|
let user = TelegramUser(id: EnginePeer.Id(namespace: Namespaces.Peer.CloudUser, id: cursor.getInt32(at: 0)), accessHash: accessHash == 0 ? nil : .personal(accessHash), firstName: firstName.isEmpty ? nil : firstName, lastName: lastName.isEmpty ? nil : lastName, username: username.isEmpty ? nil : username, phone: phone.isEmpty ? nil : phone, photo: photo, botInfo: nil, restrictionInfo: nil, flags: [])
|
||||||
|
|
||||||
let status: UserPresenceStatus
|
let status: UserPresenceStatus
|
||||||
let lastSeen = cursor.getInt32(at: 7)
|
let lastSeen = cursor.getInt32(at: 7)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SSignalKit
|
import SSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TextFormat
|
import TextFormat
|
||||||
|
|
@ -19,7 +18,7 @@ public enum SecureIdRequestResult: String {
|
||||||
case error = "error"
|
case error = "error"
|
||||||
}
|
}
|
||||||
|
|
||||||
public func secureIdCallbackUrl(with baseUrl: String, peerId: PeerId, result: SecureIdRequestResult, parameters: [String : String]) -> String {
|
public func secureIdCallbackUrl(with baseUrl: String, peerId: EnginePeer.Id, result: SecureIdRequestResult, parameters: [String : String]) -> String {
|
||||||
var query = (parameters.compactMap({ (key, value) -> String in
|
var query = (parameters.compactMap({ (key, value) -> String in
|
||||||
return "\(key)=\(value)"
|
return "\(key)=\(value)"
|
||||||
}) as Array).joined(separator: "&")
|
}) as Array).joined(separator: "&")
|
||||||
|
|
@ -64,7 +63,7 @@ final class SecureIdAuthControllerInteraction {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SecureIdAuthControllerMode {
|
public enum SecureIdAuthControllerMode {
|
||||||
case form(peerId: PeerId, scope: String, publicKey: String, callbackUrl: String?, opaquePayload: Data, opaqueNonce: Data)
|
case form(peerId: EnginePeer.Id, scope: String, publicKey: String, callbackUrl: String?, opaquePayload: Data, opaqueNonce: Data)
|
||||||
case list
|
case list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -174,7 +173,7 @@ public final class SecureIdAuthController: ViewController, StandalonePresentable
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
let handleError: (Any, String?, PeerId?) -> Void = { [weak self] error, callbackUrl, peerId in
|
let handleError: (Any, String?, EnginePeer.Id?) -> Void = { [weak self] error, callbackUrl, peerId in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
var passError: String?
|
var passError: String?
|
||||||
var appUpdateRequired = false
|
var appUpdateRequired = false
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
|
||||||
struct SecureIdEncryptedFormData {
|
struct SecureIdEncryptedFormData {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import PhoneNumberFormat
|
||||||
import UndoUI
|
import UndoUI
|
||||||
import GalleryUI
|
import GalleryUI
|
||||||
import PeerAvatarGalleryUI
|
import PeerAvatarGalleryUI
|
||||||
import Postbox
|
|
||||||
import ContextUI
|
import ContextUI
|
||||||
|
|
||||||
private enum DeviceContactInfoAction {
|
private enum DeviceContactInfoAction {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import ItemListUI
|
import ItemListUI
|
||||||
|
|
@ -117,7 +116,7 @@ private func groupPreHistorySetupEntries(isSupergroup: Bool, presentationData: P
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
|
||||||
public func groupPreHistorySetupController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, peerId: PeerId, upgradedToSupergroup: @escaping (PeerId, @escaping () -> Void) -> Void) -> ViewController {
|
public func groupPreHistorySetupController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, peerId: EnginePeer.Id, upgradedToSupergroup: @escaping (EnginePeer.Id, @escaping () -> Void) -> Void) -> ViewController {
|
||||||
let statePromise = ValuePromise(GroupPreHistorySetupState(), ignoreRepeated: true)
|
let statePromise = ValuePromise(GroupPreHistorySetupState(), ignoreRepeated: true)
|
||||||
let stateValue = Atomic(value: GroupPreHistorySetupState())
|
let stateValue = Atomic(value: GroupPreHistorySetupState())
|
||||||
let updateState: ((GroupPreHistorySetupState) -> GroupPreHistorySetupState) -> Void = { f in
|
let updateState: ((GroupPreHistorySetupState) -> GroupPreHistorySetupState) -> Void = { f in
|
||||||
|
|
@ -163,12 +162,12 @@ public func groupPreHistorySetupController(context: AccountContext, updatedPrese
|
||||||
if let value = value, value != defaultValue {
|
if let value = value, value != defaultValue {
|
||||||
if peerId.namespace == Namespaces.Peer.CloudGroup {
|
if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||||
let signal = context.engine.peers.convertGroupToSupergroup(peerId: peerId)
|
let signal = context.engine.peers.convertGroupToSupergroup(peerId: peerId)
|
||||||
|> mapToSignal { upgradedPeerId -> Signal<PeerId?, ConvertGroupToSupergroupError> in
|
|> mapToSignal { upgradedPeerId -> Signal<EnginePeer.Id?,ConvertGroupToSupergroupError> in
|
||||||
return context.engine.peers.updateChannelHistoryAvailabilitySettingsInteractively(peerId: upgradedPeerId, historyAvailableForNewMembers: value)
|
return context.engine.peers.updateChannelHistoryAvailabilitySettingsInteractively(peerId: upgradedPeerId, historyAvailableForNewMembers: value)
|
||||||
|> `catch` { _ -> Signal<Void, NoError> in
|
|> `catch` { _ -> Signal<Void, NoError> in
|
||||||
return .complete()
|
return .complete()
|
||||||
}
|
}
|
||||||
|> mapToSignal { _ -> Signal<PeerId?, NoError> in
|
|> mapToSignal { _ -> Signal<EnginePeer.Id?,NoError> in
|
||||||
return .complete()
|
return .complete()
|
||||||
}
|
}
|
||||||
|> then(.single(upgradedPeerId))
|
|> then(.single(upgradedPeerId))
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import ItemListUI
|
import ItemListUI
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -467,7 +466,7 @@ private func fetchDomainExceptionInfo(context: AccountContext, url: String) -> S
|
||||||
let resource = LocalFileMediaResource(fileId: Int64.random(in: Int64.min ... Int64.max))
|
let resource = LocalFileMediaResource(fileId: Int64.random(in: Int64.min ... Int64.max))
|
||||||
context.sharedContext.accountManager.resources.storeResourceData(id: EngineMediaResource.Id(resource.id), data: imageData)
|
context.sharedContext.accountManager.resources.storeResourceData(id: EngineMediaResource.Id(resource.id), data: imageData)
|
||||||
image = TelegramMediaImage(
|
image = TelegramMediaImage(
|
||||||
imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: Int64.random(in: Int64.min ... Int64.max)),
|
imageId: EngineMedia.Id(namespace: Namespaces.Media.LocalImage, id: Int64.random(in: Int64.min ... Int64.max)),
|
||||||
representations: [
|
representations: [
|
||||||
TelegramMediaImageRepresentation(
|
TelegramMediaImageRepresentation(
|
||||||
dimensions: PixelDimensions(width: Int32(parsedImage.size.width), height: Int32(parsedImage.size.height)),
|
dimensions: PixelDimensions(width: Int32(parsedImage.size.width), height: Int32(parsedImage.size.height)),
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -15,12 +14,12 @@ import ItemListPeerActionItem
|
||||||
private final class BlockedPeersControllerArguments {
|
private final class BlockedPeersControllerArguments {
|
||||||
let context: AccountContext
|
let context: AccountContext
|
||||||
|
|
||||||
let setPeerIdWithRevealedOptions: (PeerId?, PeerId?) -> Void
|
let setPeerIdWithRevealedOptions: (EnginePeer.Id?, EnginePeer.Id?) -> Void
|
||||||
let addPeer: () -> Void
|
let addPeer: () -> Void
|
||||||
let removePeer: (PeerId) -> Void
|
let removePeer: (EnginePeer.Id) -> Void
|
||||||
let openPeer: (EnginePeer) -> Void
|
let openPeer: (EnginePeer) -> Void
|
||||||
|
|
||||||
init(context: AccountContext, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, addPeer: @escaping () -> Void, removePeer: @escaping (PeerId) -> Void, openPeer: @escaping (EnginePeer) -> Void) {
|
init(context: AccountContext, setPeerIdWithRevealedOptions: @escaping (EnginePeer.Id?, EnginePeer.Id?) -> Void, addPeer: @escaping () -> Void, removePeer: @escaping (EnginePeer.Id) -> Void, openPeer: @escaping (EnginePeer) -> Void) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.setPeerIdWithRevealedOptions = setPeerIdWithRevealedOptions
|
self.setPeerIdWithRevealedOptions = setPeerIdWithRevealedOptions
|
||||||
self.addPeer = addPeer
|
self.addPeer = addPeer
|
||||||
|
|
@ -36,7 +35,7 @@ private enum BlockedPeersSection: Int32 {
|
||||||
|
|
||||||
private enum BlockedPeersEntryStableId: Hashable {
|
private enum BlockedPeersEntryStableId: Hashable {
|
||||||
case add
|
case add
|
||||||
case peer(PeerId)
|
case peer(EnginePeer.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum BlockedPeersEntry: ItemListNodeEntry {
|
private enum BlockedPeersEntry: ItemListNodeEntry {
|
||||||
|
|
@ -145,8 +144,8 @@ private enum BlockedPeersEntry: ItemListNodeEntry {
|
||||||
|
|
||||||
private struct BlockedPeersControllerState: Equatable {
|
private struct BlockedPeersControllerState: Equatable {
|
||||||
let editing: Bool
|
let editing: Bool
|
||||||
let peerIdWithRevealedOptions: PeerId?
|
let peerIdWithRevealedOptions: EnginePeer.Id?
|
||||||
let removingPeerId: PeerId?
|
let removingPeerId: EnginePeer.Id?
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
self.editing = false
|
self.editing = false
|
||||||
|
|
@ -154,7 +153,7 @@ private struct BlockedPeersControllerState: Equatable {
|
||||||
self.removingPeerId = nil
|
self.removingPeerId = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init(editing: Bool, peerIdWithRevealedOptions: PeerId?, removingPeerId: PeerId?) {
|
init(editing: Bool, peerIdWithRevealedOptions: EnginePeer.Id?, removingPeerId: EnginePeer.Id?) {
|
||||||
self.editing = editing
|
self.editing = editing
|
||||||
self.peerIdWithRevealedOptions = peerIdWithRevealedOptions
|
self.peerIdWithRevealedOptions = peerIdWithRevealedOptions
|
||||||
self.removingPeerId = removingPeerId
|
self.removingPeerId = removingPeerId
|
||||||
|
|
@ -178,11 +177,11 @@ private struct BlockedPeersControllerState: Equatable {
|
||||||
return BlockedPeersControllerState(editing: editing, peerIdWithRevealedOptions: self.peerIdWithRevealedOptions, removingPeerId: self.removingPeerId)
|
return BlockedPeersControllerState(editing: editing, peerIdWithRevealedOptions: self.peerIdWithRevealedOptions, removingPeerId: self.removingPeerId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func withUpdatedPeerIdWithRevealedOptions(_ peerIdWithRevealedOptions: PeerId?) -> BlockedPeersControllerState {
|
func withUpdatedPeerIdWithRevealedOptions(_ peerIdWithRevealedOptions: EnginePeer.Id?) -> BlockedPeersControllerState {
|
||||||
return BlockedPeersControllerState(editing: self.editing, peerIdWithRevealedOptions: peerIdWithRevealedOptions, removingPeerId: self.removingPeerId)
|
return BlockedPeersControllerState(editing: self.editing, peerIdWithRevealedOptions: peerIdWithRevealedOptions, removingPeerId: self.removingPeerId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func withUpdatedRemovingPeerId(_ removingPeerId: PeerId?) -> BlockedPeersControllerState {
|
func withUpdatedRemovingPeerId(_ removingPeerId: EnginePeer.Id?) -> BlockedPeersControllerState {
|
||||||
return BlockedPeersControllerState(editing: self.editing, peerIdWithRevealedOptions: self.peerIdWithRevealedOptions, removingPeerId: removingPeerId)
|
return BlockedPeersControllerState(editing: self.editing, peerIdWithRevealedOptions: self.peerIdWithRevealedOptions, removingPeerId: removingPeerId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
import LocalAuthentication
|
import LocalAuthentication
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
||||||
private struct SettingsSearchRecentQueryItemId {
|
private struct SettingsSearchRecentQueryItemId {
|
||||||
public let rawValue: MemoryBuffer
|
public let rawValue: EngineMemoryBuffer
|
||||||
|
|
||||||
var value: Int64 {
|
var value: Int64 {
|
||||||
return self.rawValue.makeData().withUnsafeBytes { buffer -> Int64 in
|
return self.rawValue.makeData().withUnsafeBytes { buffer -> Int64 in
|
||||||
|
|
@ -17,13 +16,13 @@ private struct SettingsSearchRecentQueryItemId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init(_ rawValue: MemoryBuffer) {
|
init(_ rawValue: EngineMemoryBuffer) {
|
||||||
self.rawValue = rawValue
|
self.rawValue = rawValue
|
||||||
}
|
}
|
||||||
|
|
||||||
init(_ value: Int64) {
|
init(_ value: Int64) {
|
||||||
var value = value
|
var value = value
|
||||||
self.rawValue = MemoryBuffer(data: Data(bytes: &value, count: MemoryLayout.size(ofValue: value)))
|
self.rawValue = EngineMemoryBuffer(data: Data(bytes: &value, count: MemoryLayout.size(ofValue: value)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +41,7 @@ func addRecentSettingsSearchItem(engine: TelegramEngine, item: AnyHashable) {
|
||||||
guard let id = item.base as? String, let data = id.data(using: .ascii) else {
|
guard let id = item.base as? String, let data = id.data(using: .ascii) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let itemId = MemoryBuffer(data: data)
|
let itemId = EngineMemoryBuffer(data: data)
|
||||||
let _ = engine.orderedLists.addOrMoveToFirstPosition(collectionId: ApplicationSpecificOrderedItemListCollectionId.settingsSearchRecentItems, id: itemId, item: RecentSettingsSearchQueryItem(), removeTailIfCountExceeds: 100).start()
|
let _ = engine.orderedLists.addOrMoveToFirstPosition(collectionId: ApplicationSpecificOrderedItemListCollectionId.settingsSearchRecentItems, id: itemId, item: RecentSettingsSearchQueryItem(), removeTailIfCountExceeds: 100).start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,7 +49,7 @@ func removeRecentSettingsSearchItem(engine: TelegramEngine, item: AnyHashable) {
|
||||||
guard let id = item.base as? String, let data = id.data(using: .ascii) else {
|
guard let id = item.base as? String, let data = id.data(using: .ascii) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let itemId = MemoryBuffer(data: data)
|
let itemId = EngineMemoryBuffer(data: data)
|
||||||
let _ = engine.orderedLists.removeItem(collectionId: ApplicationSpecificOrderedItemListCollectionId.settingsSearchRecentItems, id: itemId).start()
|
let _ = engine.orderedLists.removeItem(collectionId: ApplicationSpecificOrderedItemListCollectionId.settingsSearchRecentItems, id: itemId).start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -303,7 +302,7 @@ private func editThemeControllerEntries(presentationData: PresentationData, stat
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
|
||||||
public func editThemeController(context: AccountContext, mode: EditThemeControllerMode, navigateToChat: ((PeerId) -> Void)? = nil, completion: ((PresentationThemeReference) -> Void)? = nil) -> ViewController {
|
public func editThemeController(context: AccountContext, mode: EditThemeControllerMode, navigateToChat: ((EnginePeer.Id) -> Void)? = nil, completion: ((PresentationThemeReference) -> Void)? = nil) -> ViewController {
|
||||||
let initialState: EditThemeControllerState
|
let initialState: EditThemeControllerState
|
||||||
let previewThemePromise = Promise<PresentationTheme>()
|
let previewThemePromise = Promise<PresentationTheme>()
|
||||||
let settingsPromise = Promise<TelegramThemeSettings?>(nil)
|
let settingsPromise = Promise<TelegramThemeSettings?>(nil)
|
||||||
|
|
@ -538,7 +537,7 @@ public func editThemeController(context: AccountContext, mode: EditThemeControll
|
||||||
let _ = (combineLatest(queue: Queue.mainQueue(), previewThemePromise.get(), settingsPromise.get())
|
let _ = (combineLatest(queue: Queue.mainQueue(), previewThemePromise.get(), settingsPromise.get())
|
||||||
|> take(1)).start(next: { previewTheme, settings in
|
|> take(1)).start(next: { previewTheme, settings in
|
||||||
let saveThemeTemplateFile: (String, LocalFileMediaResource, @escaping () -> Void) -> Void = { title, resource, completion in
|
let saveThemeTemplateFile: (String, LocalFileMediaResource, @escaping () -> Void) -> Void = { title, resource, completion in
|
||||||
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: resource.fileId), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "application/x-tgtheme-ios", size: nil, attributes: [.FileName(fileName: "\(title).tgios-theme")], alternativeRepresentations: [])
|
let file = TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: resource.fileId), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "application/x-tgtheme-ios", size: nil, attributes: [.FileName(fileName: "\(title).tgios-theme")], alternativeRepresentations: [])
|
||||||
let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||||
|
|
||||||
let _ = enqueueMessages(account: context.account, peerId: context.account.peerId, messages: [message]).start()
|
let _ = enqueueMessages(account: context.account, peerId: context.account.peerId, messages: [message]).start()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
|
@ -411,7 +410,7 @@ public final class ThemePreviewController: ViewController {
|
||||||
|
|
||||||
var themeSpecificChatWallpapers = updatedSettings.themeSpecificChatWallpapers
|
var themeSpecificChatWallpapers = updatedSettings.themeSpecificChatWallpapers
|
||||||
themeSpecificChatWallpapers[updatedTheme.index] = nil
|
themeSpecificChatWallpapers[updatedTheme.index] = nil
|
||||||
return PreferencesEntry(updatedSettings.withUpdatedThemeSpecificChatWallpapers(themeSpecificChatWallpapers).withUpdatedThemeSpecificAccentColors(themeSpecificAccentColors))
|
return EnginePreferencesEntry(updatedSettings.withUpdatedThemeSpecificChatWallpapers(themeSpecificChatWallpapers).withUpdatedThemeSpecificAccentColors(themeSpecificAccentColors))
|
||||||
})
|
})
|
||||||
return previousDefaultTheme
|
return previousDefaultTheme
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ swift_library(
|
||||||
]),
|
]),
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/Postbox:Postbox",
|
|
||||||
"//submodules/SyncCore:SyncCore",
|
"//submodules/SyncCore:SyncCore",
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -510,7 +509,7 @@ public func messageStatsController(context: AccountContext, updatedPresentationD
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
openStoryImpl = { [weak controller] peerId, story, sourceView in
|
openStoryImpl = { [weak controller] peerId, story, sourceView in
|
||||||
let storyContent = SingleStoryContentContextImpl(context: context, storyId: StoryId(peerId: peerId, id: story.id), storyItem: story, readGlobally: false)
|
let storyContent = SingleStoryContentContextImpl(context: context, storyId: EngineStoryId(peerId: peerId, id: story.id), storyItem: story, readGlobally: false)
|
||||||
let _ = (storyContent.state
|
let _ = (storyContent.state
|
||||||
|> take(1)
|
|> take(1)
|
||||||
|> deliverOnMainQueue).startStandalone(next: { [weak controller, weak sourceView] _ in
|
|> deliverOnMainQueue).startStandalone(next: { [weak controller, weak sourceView] _ in
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import StickerResources
|
import StickerResources
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import AnimatedStickerNode
|
import AnimatedStickerNode
|
||||||
|
|
@ -16,7 +15,7 @@ import TextFormat
|
||||||
|
|
||||||
final class StickerPackPreviewInteraction {
|
final class StickerPackPreviewInteraction {
|
||||||
var previewedItem: StickerPreviewPeekItem?
|
var previewedItem: StickerPreviewPeekItem?
|
||||||
var reorderingFileId: MediaId?
|
var reorderingFileId: EngineMedia.Id?
|
||||||
var playAnimatedStickers: Bool
|
var playAnimatedStickers: Bool
|
||||||
|
|
||||||
let addStickerPack: (StickerPackCollectionInfo, [StickerPackItem]) -> Void
|
let addStickerPack: (StickerPackCollectionInfo, [StickerPackItem]) -> Void
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
import UniversalMediaPlayer
|
import UniversalMediaPlayer
|
||||||
|
|
@ -14,7 +13,7 @@ import PresentationDataUtils
|
||||||
import TelegramCallsUI
|
import TelegramCallsUI
|
||||||
import UndoUI
|
import UndoUI
|
||||||
|
|
||||||
private func presentLiveLocationController(context: AccountContext, peerId: PeerId, controller: ViewController) {
|
private func presentLiveLocationController(context: AccountContext, peerId: EnginePeer.Id, controller: ViewController) {
|
||||||
let presentImpl: (EngineMessage?) -> Void = { [weak controller] message in
|
let presentImpl: (EngineMessage?) -> Void = { [weak controller] message in
|
||||||
if let message = message, let strongController = controller {
|
if let message = message, let strongController = controller {
|
||||||
let _ = context.sharedContext.openChatMessage(OpenChatMessageParams(context: context, chatLocation: nil, chatFilterTag: nil, chatLocationContextHolder: nil, message: message._asMessage(), standalone: false, reverseMessageGalleryOrder: false, navigationController: strongController.navigationController as? NavigationController, modal: true, dismissInput: {
|
let _ = context.sharedContext.openChatMessage(OpenChatMessageParams(context: context, chatLocation: nil, chatFilterTag: nil, chatLocationContextHolder: nil, message: message._asMessage(), standalone: false, reverseMessageGalleryOrder: false, navigationController: strongController.navigationController as? NavigationController, modal: true, dismissInput: {
|
||||||
|
|
@ -189,7 +188,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
|
||||||
})]
|
})]
|
||||||
}
|
}
|
||||||
|
|
||||||
open func joinGroupCall(peerId: PeerId, invite: String?, activeCall: EngineGroupCallDescription) {
|
open func joinGroupCall(peerId: EnginePeer.Id, invite: String?, activeCall: EngineGroupCallDescription) {
|
||||||
let context = self.context
|
let context = self.context
|
||||||
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
|
|
@ -224,7 +223,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultJoinAsPeerId: PeerId? = callJoinAsPeerId
|
let defaultJoinAsPeerId: EnginePeer.Id? = callJoinAsPeerId
|
||||||
|
|
||||||
if peers.count == 1, let peer = peers.first {
|
if peers.count == 1, let peer = peers.first {
|
||||||
completion(peer.peer.id)
|
completion(peer.peer.id)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import SwiftSignalKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramVoip
|
import TelegramVoip
|
||||||
|
|
@ -12,14 +11,14 @@ import AccountContext
|
||||||
import AlertComponent
|
import AlertComponent
|
||||||
|
|
||||||
func rateCallAndSendLogs(engine: TelegramEngine, callId: CallId, starsCount: Int, comment: String, userInitiated: Bool, includeLogs: Bool) -> Signal<Void, NoError> {
|
func rateCallAndSendLogs(engine: TelegramEngine, callId: CallId, starsCount: Int, comment: String, userInitiated: Bool, includeLogs: Bool) -> Signal<Void, NoError> {
|
||||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(4244000))
|
let peerId = EnginePeer.Id(namespace: Namespaces.Peer.CloudUser, id: EnginePeer.Id.Id._internalFromInt64Value(4244000))
|
||||||
|
|
||||||
let rate = engine.calls.rateCall(callId: callId, starsCount: Int32(starsCount), comment: comment, userInitiated: userInitiated)
|
let rate = engine.calls.rateCall(callId: callId, starsCount: Int32(starsCount), comment: comment, userInitiated: userInitiated)
|
||||||
if includeLogs {
|
if includeLogs {
|
||||||
let id = Int64.random(in: Int64.min ... Int64.max)
|
let id = Int64.random(in: Int64.min ... Int64.max)
|
||||||
let name = "\(callId.id)_\(callId.accessHash).log.json"
|
let name = "\(callId.id)_\(callId.accessHash).log.json"
|
||||||
let path = callLogsPath(account: engine.account) + "/" + name
|
let path = callLogsPath(account: engine.account) + "/" + name
|
||||||
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: id), partialReference: nil, resource: LocalFileReferenceMediaResource(localFilePath: path, randomId: id), previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "application/text", size: nil, attributes: [.FileName(fileName: name)], alternativeRepresentations: [])
|
let file = TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: id), partialReference: nil, resource: LocalFileReferenceMediaResource(localFilePath: path, randomId: id), previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "application/text", size: nil, attributes: [.FileName(fileName: name)], alternativeRepresentations: [])
|
||||||
let message = EnqueueMessage.message(text: comment, attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
let message = EnqueueMessage.message(text: comment, attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||||
return rate
|
return rate
|
||||||
|> then(enqueueMessages(account: engine.account, peerId: peerId, messages: [message])
|
|> then(enqueueMessages(account: engine.account, peerId: peerId, messages: [message])
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import Display
|
||||||
import UIKit
|
import UIKit
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import AvatarNode
|
import AvatarNode
|
||||||
import GlassBackgroundComponent
|
import GlassBackgroundComponent
|
||||||
|
|
@ -89,7 +88,7 @@ final class MessageItemComponent: Component {
|
||||||
weak var standaloneReactionAnimation: StandaloneReactionAnimation?
|
weak var standaloneReactionAnimation: StandaloneReactionAnimation?
|
||||||
|
|
||||||
private var cachedEntities: [MessageTextEntity]?
|
private var cachedEntities: [MessageTextEntity]?
|
||||||
private var entityFiles: [MediaId: TelegramMediaFile] = [:]
|
private var entityFiles: [EngineMedia.Id: TelegramMediaFile] = [:]
|
||||||
|
|
||||||
private var component: MessageItemComponent?
|
private var component: MessageItemComponent?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Display
|
import Display
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -22,7 +21,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
||||||
private var animatedIn = false
|
private var animatedIn = false
|
||||||
|
|
||||||
private let context: AccountContext
|
private let context: AccountContext
|
||||||
private let peerId: PeerId
|
private let peerId: EnginePeer.Id
|
||||||
private let invite: String?
|
private let invite: String?
|
||||||
private var join: (CachedChannelData.ActiveCall) -> Void
|
private var join: (CachedChannelData.ActiveCall) -> Void
|
||||||
|
|
||||||
|
|
@ -30,7 +29,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
||||||
|
|
||||||
private let disposable = MetaDisposable()
|
private let disposable = MetaDisposable()
|
||||||
|
|
||||||
public init(context: AccountContext, peerId: PeerId, invite: String?, join: @escaping (CachedChannelData.ActiveCall) -> Void) {
|
public init(context: AccountContext, peerId: EnginePeer.Id, invite: String?, join: @escaping (CachedChannelData.ActiveCall) -> Void) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.peerId = peerId
|
self.peerId = peerId
|
||||||
self.invite = invite
|
self.invite = invite
|
||||||
|
|
@ -132,7 +131,7 @@ public final class VoiceChatJoinScreen: ViewController {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultJoinAsPeerId: PeerId? = callJoinAsPeerId
|
let defaultJoinAsPeerId: EnginePeer.Id? = callJoinAsPeerId
|
||||||
|
|
||||||
let activeCall = CachedChannelData.ActiveCall(id: call.info.id, accessHash: call.info.accessHash, title: call.info.title, scheduleTimestamp: call.info.scheduleTimestamp, subscribedToScheduled: call.info.subscribedToScheduled, isStream: call.info.isStream)
|
let activeCall = CachedChannelData.ActiveCall(id: call.info.id, accessHash: call.info.accessHash, title: call.info.title, scheduleTimestamp: call.info.scheduleTimestamp, subscribedToScheduled: call.info.subscribedToScheduled, isStream: call.info.isStream)
|
||||||
if availablePeers.count > 0 && defaultJoinAsPeerId == nil {
|
if availablePeers.count > 0 && defaultJoinAsPeerId == nil {
|
||||||
|
|
@ -682,7 +681,7 @@ final class VoiceChatPreviewContentNode: ASDisplayNode, ShareContentContainerNod
|
||||||
func deactivate() {
|
func deactivate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setEnsurePeerVisibleOnLayout(_ peerId: PeerId?) {
|
func setEnsurePeerVisibleOnLayout(_ peerId: EnginePeer.Id?) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setDidBeginDragging(_ f: (() -> Void)?) {
|
func setDidBeginDragging(_ f: (() -> Void)?) {
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@ public typealias EnginePostboxDecoder = PostboxDecoder
|
||||||
public typealias EnginePostboxEncoder = PostboxEncoder
|
public typealias EnginePostboxEncoder = PostboxEncoder
|
||||||
public typealias EngineAdaptedPostboxDecoder = AdaptedPostboxDecoder
|
public typealias EngineAdaptedPostboxDecoder = AdaptedPostboxDecoder
|
||||||
public typealias EngineItemCollectionId = ItemCollectionId
|
public typealias EngineItemCollectionId = ItemCollectionId
|
||||||
|
public typealias EngineStoryId = StoryId
|
||||||
public typealias EngineFetchResourceSourceType = FetchResourceSourceType
|
public typealias EngineFetchResourceSourceType = FetchResourceSourceType
|
||||||
public typealias EngineFetchResourceError = FetchResourceError
|
public typealias EngineFetchResourceError = FetchResourceError
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -285,7 +284,7 @@ public func messageTextWithAttributes(message: EngineMessage) -> NSAttributedStr
|
||||||
|
|
||||||
let currentDict = updatedString.attributes(at: range.lowerBound, effectiveRange: nil)
|
let currentDict = updatedString.attributes(at: range.lowerBound, effectiveRange: nil)
|
||||||
var updatedAttributes: [NSAttributedString.Key: Any] = currentDict
|
var updatedAttributes: [NSAttributedString.Key: Any] = currentDict
|
||||||
updatedAttributes[ChatTextInputAttributes.customEmoji] = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: fileId, file: message.associatedMedia[MediaId(namespace: Namespaces.Media.CloudFile, id: fileId)] as? TelegramMediaFile)
|
updatedAttributes[ChatTextInputAttributes.customEmoji] = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: fileId, file: message.associatedMedia[EngineMedia.Id(namespace: Namespaces.Media.CloudFile, id: fileId)] as? TelegramMediaFile)
|
||||||
|
|
||||||
let insertString = NSAttributedString(string: updatedString.attributedSubstring(from: range).string, attributes: updatedAttributes)
|
let insertString = NSAttributedString(string: updatedString.attributedSubstring(from: range).string, attributes: updatedAttributes)
|
||||||
updatedString.replaceCharacters(in: range, with: insertString)
|
updatedString.replaceCharacters(in: range, with: insertString)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ swift_library(
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/AccountContext",
|
"//submodules/AccountContext",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/TelegramUIPreferences",
|
"//submodules/TelegramUIPreferences",
|
||||||
"//submodules/StickerResources",
|
"//submodules/StickerResources",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -252,7 +251,7 @@ final class ChatAdPanelNode: ASDisplayNode {
|
||||||
return panelHeight
|
return panelHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
private func enqueueTransition(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition, animation: PinnedMessageAnimation?, message: EngineMessage, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, accountPeerId: PeerId, firstTime: Bool, isReplyThread: Bool, translateToLanguage: String?) -> CGFloat {
|
private func enqueueTransition(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition, animation: PinnedMessageAnimation?, message: EngineMessage, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, accountPeerId: EnginePeer.Id, firstTime: Bool, isReplyThread: Bool, translateToLanguage: String?) -> CGFloat {
|
||||||
var animationTransition: ContainedViewLayoutTransition = .immediate
|
var animationTransition: ContainedViewLayoutTransition = .immediate
|
||||||
|
|
||||||
if let animation = animation {
|
if let animation = animation {
|
||||||
|
|
@ -313,7 +312,7 @@ final class ChatAdPanelNode: ASDisplayNode {
|
||||||
} else if let paidContent = media as? TelegramMediaPaidContent, let firstMedia = paidContent.extendedMedia.first {
|
} else if let paidContent = media as? TelegramMediaPaidContent, let firstMedia = paidContent.extendedMedia.first {
|
||||||
switch firstMedia {
|
switch firstMedia {
|
||||||
case let .preview(dimensions, immediateThumbnailData, _):
|
case let .preview(dimensions, immediateThumbnailData, _):
|
||||||
let thumbnailMedia = TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
|
let thumbnailMedia = TelegramMediaImage(imageId: EngineMedia.Id(namespace: 0, id: 0), representations: [], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
|
||||||
if let dimensions {
|
if let dimensions {
|
||||||
imageDimensions = dimensions.cgSize
|
imageDimensions = dimensions.cgSize
|
||||||
}
|
}
|
||||||
|
|
@ -353,7 +352,7 @@ final class ChatAdPanelNode: ASDisplayNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
var updateImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
||||||
var updatedFetchMediaSignal: Signal<FetchResourceSourceType, FetchResourceError>?
|
var updatedFetchMediaSignal: Signal<EngineFetchResourceSourceType, EngineFetchResourceError>?
|
||||||
if mediaUpdated {
|
if mediaUpdated {
|
||||||
if let updatedMediaReference = updatedMediaReference, imageDimensions != nil {
|
if let updatedMediaReference = updatedMediaReference, imageDimensions != nil {
|
||||||
if let imageReference = updatedMediaReference.concrete(TelegramMediaImage.self) {
|
if let imageReference = updatedMediaReference.concrete(TelegramMediaImage.self) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -145,7 +144,7 @@ final class CameraLiveStreamComponent: Component {
|
||||||
|
|
||||||
if let story = component.story {
|
if let story = component.story {
|
||||||
if self.storyContentDisposable == nil {
|
if self.storyContentDisposable == nil {
|
||||||
let storyContent = SingleStoryContentContextImpl(context: component.context, storyId: StoryId(peerId: component.peerId, id: story.id), storyItem: story, readGlobally: false)
|
let storyContent = SingleStoryContentContextImpl(context: component.context, storyId: EngineStoryId(peerId: component.peerId, id: story.id), storyItem: story, readGlobally: false)
|
||||||
self.storyContent = storyContent
|
self.storyContent = storyContent
|
||||||
self.storyContentDisposable = (storyContent.state
|
self.storyContentDisposable = (storyContent.state
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] state in
|
|> deliverOnMainQueue).start(next: { [weak self] state in
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/TextFormat",
|
"//submodules/TextFormat",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TextFormat
|
import TextFormat
|
||||||
|
|
@ -150,7 +149,7 @@ public final class ChatBotInfoItemNode: ListViewItemNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
let videoContent = NativeVideoContent(
|
let videoContent = NativeVideoContent(
|
||||||
id: .message(0, MediaId(namespace: 0, id: Int64.random(in: 0..<Int64.max))),
|
id: .message(0, EngineMedia.Id(namespace: 0, id: Int64.random(in: 0..<Int64.max))),
|
||||||
userLocation: .other,
|
userLocation: .other,
|
||||||
fileReference: .standalone(media: file),
|
fileReference: .standalone(media: file),
|
||||||
streamVideo: .none,
|
streamVideo: .none,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/PhotoResources",
|
"//submodules/PhotoResources",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
|
|
@ -134,7 +133,7 @@ private final class ChatContextResultPeekNode: ASDisplayNode, PeekControllerCont
|
||||||
imageDimensions = externalReference.content?.dimensions?.cgSize
|
imageDimensions = externalReference.content?.dimensions?.cgSize
|
||||||
if let content = externalReference.content, externalReference.type == "gif", let thumbnailResource = imageResource
|
if let content = externalReference.content, externalReference.type == "gif", let thumbnailResource = imageResource
|
||||||
, let dimensions = content.dimensions {
|
, let dimensions = content.dimensions {
|
||||||
videoFileReference = .standalone(media: TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: 0), partialReference: nil, resource: content.resource, previewRepresentations: [TelegramMediaImageRepresentation(dimensions: dimensions, resource: thumbnailResource, progressiveSizes: [], immediateThumbnailData: nil, hasVideo: false, isPersonal: false)], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.Animated, .Video(duration: 0, size: dimensions, flags: [], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: []))
|
videoFileReference = .standalone(media: TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: 0), partialReference: nil, resource: content.resource, previewRepresentations: [TelegramMediaImageRepresentation(dimensions: dimensions, resource: thumbnailResource, progressiveSizes: [], immediateThumbnailData: nil, hasVideo: false, isPersonal: false)], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.Animated, .Video(duration: 0, size: dimensions, flags: [], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: []))
|
||||||
imageResource = nil
|
imageResource = nil
|
||||||
}
|
}
|
||||||
case let .internalReference(internalReference):
|
case let .internalReference(internalReference):
|
||||||
|
|
@ -197,7 +196,7 @@ private final class ChatContextResultPeekNode: ASDisplayNode, PeekControllerCont
|
||||||
if updatedImageResource {
|
if updatedImageResource {
|
||||||
if let imageResource = imageResource {
|
if let imageResource = imageResource {
|
||||||
let tmpRepresentation = TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: Int32(fittedImageDimensions.width * 2.0), height: Int32(fittedImageDimensions.height * 2.0)), resource: imageResource, progressiveSizes: [], immediateThumbnailData: nil, hasVideo: false, isPersonal: false)
|
let tmpRepresentation = TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: Int32(fittedImageDimensions.width * 2.0), height: Int32(fittedImageDimensions.height * 2.0)), resource: imageResource, progressiveSizes: [], immediateThumbnailData: nil, hasVideo: false, isPersonal: false)
|
||||||
let tmpImage = TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [tmpRepresentation], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: [])
|
let tmpImage = TelegramMediaImage(imageId: EngineMedia.Id(namespace: 0, id: 0), representations: [tmpRepresentation], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: [])
|
||||||
updateImageSignal = chatMessagePhoto(postbox: self.context.account.postbox, userLocation: .other, photoReference: .standalone(media: tmpImage))
|
updateImageSignal = chatMessagePhoto(postbox: self.context.account.postbox, userLocation: .other, photoReference: .standalone(media: tmpImage))
|
||||||
} else {
|
} else {
|
||||||
updateImageSignal = .complete()
|
updateImageSignal = .complete()
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ swift_library(
|
||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/AvatarNode",
|
"//submodules/AvatarNode",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AvatarNode
|
import AvatarNode
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
import TelegramCore
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
@ -13,14 +13,14 @@ import ChatMessageItemCommon
|
||||||
private let titleFont = UIFont.systemFont(ofSize: 13.0)
|
private let titleFont = UIFont.systemFont(ofSize: 13.0)
|
||||||
|
|
||||||
public class ChatReplyCountItem: ListViewItem {
|
public class ChatReplyCountItem: ListViewItem {
|
||||||
public let index: MessageIndex
|
public let index: EngineMessage.Index
|
||||||
public let isComments: Bool
|
public let isComments: Bool
|
||||||
public let count: Int
|
public let count: Int
|
||||||
public let presentationData: ChatPresentationData
|
public let presentationData: ChatPresentationData
|
||||||
public let header: ChatMessageDateHeader
|
public let header: ChatMessageDateHeader
|
||||||
public let controllerInteraction: ChatControllerInteraction
|
public let controllerInteraction: ChatControllerInteraction
|
||||||
|
|
||||||
public init(index: MessageIndex, isComments: Bool, count: Int, presentationData: ChatPresentationData, context: AccountContext, controllerInteraction: ChatControllerInteraction) {
|
public init(index: EngineMessage.Index, isComments: Bool, count: Int, presentationData: ChatPresentationData, context: AccountContext, controllerInteraction: ChatControllerInteraction) {
|
||||||
self.index = index
|
self.index = index
|
||||||
self.isComments = isComments
|
self.isComments = isComments
|
||||||
self.count = count
|
self.count = count
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
import TelegramCore
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
@ -13,12 +13,12 @@ import ChatMessageItemCommon
|
||||||
private let titleFont = UIFont.systemFont(ofSize: 13.0)
|
private let titleFont = UIFont.systemFont(ofSize: 13.0)
|
||||||
|
|
||||||
public class ChatUnreadItem: ListViewItem {
|
public class ChatUnreadItem: ListViewItem {
|
||||||
public let index: MessageIndex
|
public let index: EngineMessage.Index
|
||||||
public let presentationData: ChatPresentationData
|
public let presentationData: ChatPresentationData
|
||||||
public let controllerInteraction: ChatControllerInteraction
|
public let controllerInteraction: ChatControllerInteraction
|
||||||
public let header: ChatMessageDateHeader
|
public let header: ChatMessageDateHeader
|
||||||
|
|
||||||
public init(index: MessageIndex, presentationData: ChatPresentationData, controllerInteraction: ChatControllerInteraction, context: AccountContext) {
|
public init(index: EngineMessage.Index, presentationData: ChatPresentationData, controllerInteraction: ChatControllerInteraction, context: AccountContext) {
|
||||||
self.index = index
|
self.index = index
|
||||||
self.presentationData = presentationData
|
self.presentationData = presentationData
|
||||||
self.controllerInteraction = controllerInteraction
|
self.controllerInteraction = controllerInteraction
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
"//submodules/Postbox:Postbox",
|
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
"//submodules/AccountContext:AccountContext",
|
"//submodules/AccountContext:AccountContext",
|
||||||
"//submodules/TelegramPresentationData:TelegramPresentationData",
|
"//submodules/TelegramPresentationData:TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import ComponentDisplayAdapters
|
import ComponentDisplayAdapters
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ swift_library(
|
||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -211,7 +210,7 @@ public final class ChatMessageSelectionInputPanelNode: ChatInputPanelNode {
|
||||||
|
|
||||||
private let canDeleteMessagesDisposable = MetaDisposable()
|
private let canDeleteMessagesDisposable = MetaDisposable()
|
||||||
|
|
||||||
public var selectedMessages = Set<MessageId>() {
|
public var selectedMessages = Set<EngineMessage.Id>() {
|
||||||
didSet {
|
didSet {
|
||||||
if oldValue != self.selectedMessages {
|
if oldValue != self.selectedMessages {
|
||||||
self.updateActions()
|
self.updateActions()
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TextFormat",
|
"//submodules/TextFormat",
|
||||||
"//submodules/UrlEscaping",
|
"//submodules/UrlEscaping",
|
||||||
"//submodules/TelegramUniversalVideoContent",
|
"//submodules/TelegramUniversalVideoContent",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import TextFormat
|
import TextFormat
|
||||||
import UrlEscaping
|
import UrlEscaping
|
||||||
import TelegramUniversalVideoContent
|
import TelegramUniversalVideoContent
|
||||||
|
|
@ -654,7 +653,7 @@ public class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
|
||||||
|
|
||||||
let currentDict = updatedString.attributes(at: range.lowerBound, effectiveRange: nil)
|
let currentDict = updatedString.attributes(at: range.lowerBound, effectiveRange: nil)
|
||||||
var updatedAttributes: [NSAttributedString.Key: Any] = currentDict
|
var updatedAttributes: [NSAttributedString.Key: Any] = currentDict
|
||||||
updatedAttributes[ChatTextInputAttributes.customEmoji] = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: fileId, file: item.message.associatedMedia[MediaId(namespace: Namespaces.Media.CloudFile, id: fileId)] as? TelegramMediaFile)
|
updatedAttributes[ChatTextInputAttributes.customEmoji] = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: fileId, file: item.message.associatedMedia[EngineMedia.Id(namespace: Namespaces.Media.CloudFile, id: fileId)] as? TelegramMediaFile)
|
||||||
|
|
||||||
let insertString = NSAttributedString(string: updatedString.attributedSubstring(from: range).string, attributes: updatedAttributes)
|
let insertString = NSAttributedString(string: updatedString.attributedSubstring(from: range).string, attributes: updatedAttributes)
|
||||||
updatedString.replaceCharacters(in: range, with: insertString)
|
updatedString.replaceCharacters(in: range, with: insertString)
|
||||||
|
|
@ -1419,7 +1418,7 @@ public class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override public func updateSearchTextHighlightState(text: String?, messages: [MessageIndex]?) {
|
override public func updateSearchTextHighlightState(text: String?, messages: [EngineMessage.Index]?) {
|
||||||
guard let item = self.item else {
|
guard let item = self.item else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -233,7 +232,7 @@ private final class ChatRankInfoSheetContent: CombinedComponent {
|
||||||
|
|
||||||
let listItemParams = ListViewItemLayoutParams(width: previewWidth, leftInset: 0.0, rightInset: 0.0, availableHeight: 10000.0, isStandalone: true)
|
let listItemParams = ListViewItemLayoutParams(width: previewWidth, leftInset: 0.0, rightInset: 0.0, availableHeight: 10000.0, isStandalone: true)
|
||||||
|
|
||||||
let emptyUser = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: ._internalFromInt64Value(0)), accessHash: nil, firstName: "A", lastName: "", username: "", phone: "", photo: [], botInfo: nil, restrictionInfo: nil, flags: [], emojiStatus: nil, usernames: [], storiesHidden: nil, nameColor: nil, backgroundEmojiId: nil, profileColor: nil, profileBackgroundEmojiId: nil, subscriberCount: nil, verificationIconFileId: nil)
|
let emptyUser = TelegramUser(id: EnginePeer.Id(namespace: Namespaces.Peer.CloudUser, id: ._internalFromInt64Value(0)), accessHash: nil, firstName: "A", lastName: "", username: "", phone: "", photo: [], botInfo: nil, restrictionInfo: nil, flags: [], emojiStatus: nil, usernames: [], storiesHidden: nil, nameColor: nil, backgroundEmojiId: nil, profileColor: nil, profileBackgroundEmojiId: nil, subscriberCount: nil, verificationIconFileId: nil)
|
||||||
|
|
||||||
let memberMessageItem = RankChatPreviewItem.MessageItem(
|
let memberMessageItem = RankChatPreviewItem.MessageItem(
|
||||||
peer: .user(emptyUser),
|
peer: .user(emptyUser),
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramBaseController
|
import TelegramBaseController
|
||||||
|
|
@ -21,7 +20,7 @@ public final class ChatRecentActionsController: TelegramBaseController {
|
||||||
|
|
||||||
private let context: AccountContext
|
private let context: AccountContext
|
||||||
private let peer: EnginePeer
|
private let peer: EnginePeer
|
||||||
private let initialAdminPeerId: PeerId?
|
private let initialAdminPeerId: EnginePeer.Id?
|
||||||
let starsState: StarsRevenueStats?
|
let starsState: StarsRevenueStats?
|
||||||
|
|
||||||
private var presentationData: PresentationData
|
private var presentationData: PresentationData
|
||||||
|
|
@ -39,7 +38,7 @@ public final class ChatRecentActionsController: TelegramBaseController {
|
||||||
|
|
||||||
private var adminsDisposable: Disposable?
|
private var adminsDisposable: Disposable?
|
||||||
|
|
||||||
public init(context: AccountContext, peer: EnginePeer, adminPeerId: PeerId?, starsState: StarsRevenueStats?) {
|
public init(context: AccountContext, peer: EnginePeer, adminPeerId: EnginePeer.Id?, starsState: StarsRevenueStats?) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.peer = peer
|
self.peer = peer
|
||||||
self.initialAdminPeerId = adminPeerId
|
self.initialAdminPeerId = adminPeerId
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ swift_library(
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/AppBundle",
|
"//submodules/AppBundle",
|
||||||
"//submodules/ContextUI",
|
"//submodules/ContextUI",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AppBundle
|
import AppBundle
|
||||||
|
|
@ -16,14 +15,14 @@ import ContextControllerImpl
|
||||||
|
|
||||||
public final class ChatSendAsPeerListContextItem: ContextMenuCustomItem {
|
public final class ChatSendAsPeerListContextItem: ContextMenuCustomItem {
|
||||||
let context: AccountContext
|
let context: AccountContext
|
||||||
let chatPeerId: PeerId
|
let chatPeerId: EnginePeer.Id
|
||||||
let peers: [SendAsPeer]
|
let peers: [SendAsPeer]
|
||||||
let selectedPeerId: PeerId?
|
let selectedPeerId: EnginePeer.Id?
|
||||||
let isPremium: Bool
|
let isPremium: Bool
|
||||||
let action: (EnginePeer) -> Void
|
let action: (EnginePeer) -> Void
|
||||||
let presentToast: (EnginePeer) -> Void
|
let presentToast: (EnginePeer) -> Void
|
||||||
|
|
||||||
public init(context: AccountContext, chatPeerId: PeerId, peers: [SendAsPeer], selectedPeerId: PeerId?, isPremium: Bool, action: @escaping (EnginePeer) -> Void, presentToast: @escaping (EnginePeer) -> Void) {
|
public init(context: AccountContext, chatPeerId: EnginePeer.Id, peers: [SendAsPeer], selectedPeerId: EnginePeer.Id?, isPremium: Bool, action: @escaping (EnginePeer) -> Void, presentToast: @escaping (EnginePeer) -> Void) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.chatPeerId = chatPeerId
|
self.chatPeerId = chatPeerId
|
||||||
self.peers = peers
|
self.peers = peers
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ swift_library(
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
@ -1535,7 +1534,7 @@ public final class ChatSideTopicsPanel: Component {
|
||||||
public func topicIndex(threadId: Int64?) -> Int? {
|
public func topicIndex(threadId: Int64?) -> Int? {
|
||||||
if let threadId {
|
if let threadId {
|
||||||
if let value = self.rawItems.firstIndex(where: { item in
|
if let value = self.rawItems.firstIndex(where: { item in
|
||||||
if item.id == .chatList(PeerId(threadId)) {
|
if item.id == .chatList(EnginePeer.Id(threadId)) {
|
||||||
return true
|
return true
|
||||||
} else if item.id == .forum(threadId) {
|
} else if item.id == .forum(threadId) {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/TextFormat",
|
"//submodules/TextFormat",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import MobileCoreServices
|
import MobileCoreServices
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -4253,19 +4252,19 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
||||||
let _ = file
|
let _ = file
|
||||||
let _ = itemLayer
|
let _ = itemLayer
|
||||||
|
|
||||||
var collectionId: ItemCollectionId?
|
var collectionId: EngineItemCollectionId?
|
||||||
for attribute in file.attributes {
|
for attribute in file.attributes {
|
||||||
if case let .CustomEmoji(_, _, _, packReference) = attribute {
|
if case let .CustomEmoji(_, _, _, packReference) = attribute {
|
||||||
switch packReference {
|
switch packReference {
|
||||||
case let .id(id, _):
|
case let .id(id, _):
|
||||||
collectionId = ItemCollectionId(namespace: Namespaces.ItemCollection.CloudEmojiPacks, id: id)
|
collectionId = EngineItemCollectionId(namespace: Namespaces.ItemCollection.CloudEmojiPacks, id: id)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var bubbleUpEmojiOrStickersets: [ItemCollectionId] = []
|
var bubbleUpEmojiOrStickersets: [EngineItemCollectionId] = []
|
||||||
if let collectionId {
|
if let collectionId {
|
||||||
bubbleUpEmojiOrStickersets.append(collectionId)
|
bubbleUpEmojiOrStickersets.append(collectionId)
|
||||||
}
|
}
|
||||||
|
|
@ -4322,9 +4321,9 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
||||||
case let .CustomEmoji(_, _, displayText, stickerPackReference):
|
case let .CustomEmoji(_, _, displayText, stickerPackReference):
|
||||||
text = displayText
|
text = displayText
|
||||||
|
|
||||||
var packId: ItemCollectionId?
|
var packId: EngineItemCollectionId?
|
||||||
if case let .id(id, _) = stickerPackReference {
|
if case let .id(id, _) = stickerPackReference {
|
||||||
packId = ItemCollectionId(namespace: Namespaces.ItemCollection.CloudEmojiPacks, id: id)
|
packId = EngineItemCollectionId(namespace: Namespaces.ItemCollection.CloudEmojiPacks, id: id)
|
||||||
}
|
}
|
||||||
emojiAttribute = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: packId, fileId: file.fileId.id, file: file)
|
emojiAttribute = ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: packId, fileId: file.fileId.id, file: file)
|
||||||
break loop
|
break loop
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/TextFormat",
|
"//submodules/TextFormat",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TextFormat
|
import TextFormat
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,15 @@ import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import AvatarNode
|
import AvatarNode
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
||||||
private enum PeerAvatarReference: Equatable {
|
private enum PeerAvatarReference: Equatable {
|
||||||
case letters(PeerId, PeerColor?, [String])
|
case letters(EnginePeer.Id, PeerColor?, [String])
|
||||||
case image(PeerReference, TelegramMediaImageRepresentation)
|
case image(PeerReference, TelegramMediaImageRepresentation)
|
||||||
|
|
||||||
var peerId: PeerId {
|
var peerId: EnginePeer.Id {
|
||||||
switch self {
|
switch self {
|
||||||
case let .letters(value, _, _):
|
case let .letters(value, _, _):
|
||||||
return value
|
return value
|
||||||
|
|
@ -35,13 +34,13 @@ private extension PeerAvatarReference {
|
||||||
|
|
||||||
private final class MergedAvatarsNodeArguments: NSObject {
|
private final class MergedAvatarsNodeArguments: NSObject {
|
||||||
let peers: [PeerAvatarReference]
|
let peers: [PeerAvatarReference]
|
||||||
let images: [PeerId: UIImage]
|
let images: [EnginePeer.Id: UIImage]
|
||||||
let imageSize: CGFloat
|
let imageSize: CGFloat
|
||||||
let imageSpacing: CGFloat
|
let imageSpacing: CGFloat
|
||||||
let borderWidth: CGFloat
|
let borderWidth: CGFloat
|
||||||
let avatarFontSize: CGFloat
|
let avatarFontSize: CGFloat
|
||||||
|
|
||||||
init(peers: [PeerAvatarReference], images: [PeerId: UIImage], imageSize: CGFloat, imageSpacing: CGFloat, borderWidth: CGFloat, avatarFontSize: CGFloat) {
|
init(peers: [PeerAvatarReference], images: [EnginePeer.Id: UIImage], imageSize: CGFloat, imageSpacing: CGFloat, borderWidth: CGFloat, avatarFontSize: CGFloat) {
|
||||||
self.peers = peers
|
self.peers = peers
|
||||||
self.images = images
|
self.images = images
|
||||||
self.imageSize = imageSize
|
self.imageSize = imageSize
|
||||||
|
|
@ -62,8 +61,8 @@ public final class MergedAvatarsNode: ASDisplayNode {
|
||||||
public static let defaultAvatarFontSize: CGFloat = 8.0
|
public static let defaultAvatarFontSize: CGFloat = 8.0
|
||||||
|
|
||||||
private var peers: [PeerAvatarReference] = []
|
private var peers: [PeerAvatarReference] = []
|
||||||
private var images: [PeerId: UIImage] = [:]
|
private var images: [EnginePeer.Id: UIImage] = [:]
|
||||||
private var disposables: [PeerId: Disposable] = [:]
|
private var disposables: [EnginePeer.Id: Disposable] = [:]
|
||||||
private let buttonNode: HighlightTrackingButtonNode
|
private let buttonNode: HighlightTrackingButtonNode
|
||||||
private var imageSize: CGFloat = defaultMergedImageSize
|
private var imageSize: CGFloat = defaultMergedImageSize
|
||||||
private var imageSpacing: CGFloat = defaultMergedImageSpacing
|
private var imageSpacing: CGFloat = defaultMergedImageSpacing
|
||||||
|
|
@ -110,20 +109,20 @@ public final class MergedAvatarsNode: ASDisplayNode {
|
||||||
if filteredPeers != self.peers {
|
if filteredPeers != self.peers {
|
||||||
self.peers = filteredPeers
|
self.peers = filteredPeers
|
||||||
|
|
||||||
var validImageIds: [PeerId] = []
|
var validImageIds: [EnginePeer.Id] = []
|
||||||
for peer in filteredPeers {
|
for peer in filteredPeers {
|
||||||
if case .image = peer {
|
if case .image = peer {
|
||||||
validImageIds.append(peer.peerId)
|
validImageIds.append(peer.peerId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var removedImageIds: [PeerId] = []
|
var removedImageIds: [EnginePeer.Id] = []
|
||||||
for (id, _) in self.images {
|
for (id, _) in self.images {
|
||||||
if !validImageIds.contains(id) {
|
if !validImageIds.contains(id) {
|
||||||
removedImageIds.append(id)
|
removedImageIds.append(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var removedDisposableIds: [PeerId] = []
|
var removedDisposableIds: [EnginePeer.Id] = []
|
||||||
for (id, disposable) in self.disposables {
|
for (id, disposable) in self.disposables {
|
||||||
if !validImageIds.contains(id) {
|
if !validImageIds.contains(id) {
|
||||||
disposable.dispose()
|
disposable.dispose()
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
@ -24,7 +23,7 @@ import CompositeTextNode
|
||||||
public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
||||||
private let messageDisposable = MetaDisposable()
|
private let messageDisposable = MetaDisposable()
|
||||||
public let chatPeerId: EnginePeer.Id
|
public let chatPeerId: EnginePeer.Id
|
||||||
public let messageId: MessageId
|
public let messageId: EngineMessage.Id
|
||||||
public let quote: EngineMessageReplyQuote?
|
public let quote: EngineMessageReplyQuote?
|
||||||
public let innerSubject: EngineMessageReplyInnerSubject?
|
public let innerSubject: EngineMessageReplyInnerSubject?
|
||||||
|
|
||||||
|
|
@ -47,7 +46,7 @@ public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
||||||
|
|
||||||
private var validLayout: (size: CGSize, inset: CGFloat, interfaceState: ChatPresentationInterfaceState)?
|
private var validLayout: (size: CGSize, inset: CGFloat, interfaceState: ChatPresentationInterfaceState)?
|
||||||
|
|
||||||
public init(context: AccountContext, chatPeerId: EnginePeer.Id, messageId: MessageId, quote: EngineMessageReplyQuote?, innerSubject: EngineMessageReplyInnerSubject?, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, animationCache: AnimationCache?, animationRenderer: MultiAnimationRenderer?) {
|
public init(context: AccountContext, chatPeerId: EnginePeer.Id, messageId: EngineMessage.Id, quote: EngineMessageReplyQuote?, innerSubject: EngineMessageReplyInnerSubject?, theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, animationCache: AnimationCache?, animationRenderer: MultiAnimationRenderer?) {
|
||||||
self.chatPeerId = chatPeerId
|
self.chatPeerId = chatPeerId
|
||||||
self.messageId = messageId
|
self.messageId = messageId
|
||||||
self.quote = quote
|
self.quote = quote
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import SearchBarNode
|
import SearchBarNode
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -185,7 +184,7 @@ public final class PaneSearchContainerNode: ASDisplayNode, EntitySearchContainer
|
||||||
for attribute in file.attributes {
|
for attribute in file.attributes {
|
||||||
if case let .Sticker(_, packReference, _) = attribute {
|
if case let .Sticker(_, packReference, _) = attribute {
|
||||||
if case let .id(id, _) = packReference {
|
if case let .id(id, _) = packReference {
|
||||||
groupId = AnyHashable(ItemCollectionId(namespace: Namespaces.ItemCollection.CloudStickerPacks, id: id))
|
groupId = AnyHashable(EngineItemCollectionId(namespace: Namespaces.ItemCollection.CloudStickerPacks, id: id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/AccountContext",
|
"//submodules/AccountContext",
|
||||||
"//submodules/ComponentFlow",
|
"//submodules/ComponentFlow",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import ComponentFlow
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import PeerPresenceStatusManager
|
import PeerPresenceStatusManager
|
||||||
import ChatTitleActivityNode
|
import ChatTitleActivityNode
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
|
@ -170,7 +169,7 @@ public func presentPollAttachmentScreen(
|
||||||
attributes.append(.Audio(isVoice: false, duration: audioMetadata.duration, title: audioMetadata.title, performer: audioMetadata.performer, waveform: nil))
|
attributes.append(.Audio(isVoice: false, duration: audioMetadata.duration, title: audioMetadata.title, performer: audioMetadata.performer, waveform: nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: fileId), partialReference: nil, resource: ICloudFileResource(urlData: item.urlData, thumbnail: false), previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: mimeType, size: Int64(item.fileSize), attributes: attributes, alternativeRepresentations: [])
|
let file = TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: fileId), partialReference: nil, resource: ICloudFileResource(urlData: item.urlData, thumbnail: false), previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: mimeType, size: Int64(item.fileSize), attributes: attributes, alternativeRepresentations: [])
|
||||||
completion(.standalone(media: file))
|
completion(.standalone(media: file))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
"//submodules/Postbox:Postbox",
|
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/ComponentFlow:ComponentFlow",
|
"//submodules/ComponentFlow:ComponentFlow",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import TextFormat
|
||||||
import AppBundle
|
import AppBundle
|
||||||
import GZip
|
import GZip
|
||||||
import EmojiStatusComponent
|
import EmojiStatusComponent
|
||||||
import Postbox
|
|
||||||
import TelegramNotices
|
import TelegramNotices
|
||||||
|
|
||||||
private func randomGenericReactionEffect(context: AccountContext) -> Signal<String?, NoError> {
|
private func randomGenericReactionEffect(context: AccountContext) -> Signal<String?, NoError> {
|
||||||
|
|
@ -439,7 +438,7 @@ public final class EmojiStatusSelectionController: ViewController {
|
||||||
openSearch: {
|
openSearch: {
|
||||||
},
|
},
|
||||||
addGroupAction: { groupId, isPremiumLocked, _ in
|
addGroupAction: { groupId, isPremiumLocked, _ in
|
||||||
guard let strongSelf = self, let collectionId = groupId.base as? ItemCollectionId else {
|
guard let strongSelf = self, let collectionId = groupId.base as? EngineItemCollectionId else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -550,7 +549,7 @@ public final class EmojiStatusSelectionController: ViewController {
|
||||||
|> map { foundEmoji, foundPacks -> (groups: [EmojiPagerContentComponent.ItemGroup], canLoadMore: Bool, isSearching: Bool, searchContext: EmojiSearchContext?) in
|
|> map { foundEmoji, foundPacks -> (groups: [EmojiPagerContentComponent.ItemGroup], canLoadMore: Bool, isSearching: Bool, searchContext: EmojiSearchContext?) in
|
||||||
var items: [EmojiPagerContentComponent.Item] = []
|
var items: [EmojiPagerContentComponent.Item] = []
|
||||||
|
|
||||||
var existingIds = Set<MediaId>()
|
var existingIds = Set<EngineMedia.Id>()
|
||||||
for itemFile in foundEmoji.items {
|
for itemFile in foundEmoji.items {
|
||||||
if existingIds.contains(itemFile.fileId) {
|
if existingIds.contains(itemFile.fileId) {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import ComponentFlow
|
||||||
import PagerComponent
|
import PagerComponent
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import MultiAnimationRenderer
|
import MultiAnimationRenderer
|
||||||
import AnimationCache
|
import AnimationCache
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -38,8 +37,8 @@ public struct EmojiComponentReactionItem: Equatable {
|
||||||
|
|
||||||
public final class EntityKeyboardAnimationData: Equatable {
|
public final class EntityKeyboardAnimationData: Equatable {
|
||||||
public enum Id: Hashable {
|
public enum Id: Hashable {
|
||||||
case file(MediaId)
|
case file(EngineMedia.Id)
|
||||||
case stickerPackThumbnail(ItemCollectionId)
|
case stickerPackThumbnail(EngineItemCollectionId)
|
||||||
case gift(String)
|
case gift(String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,7 +266,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||||
public let externalCancel: (() -> Void)?
|
public let externalCancel: (() -> Void)?
|
||||||
public let onScroll: () -> Void
|
public let onScroll: () -> Void
|
||||||
public let loadMore: (() -> Void)?
|
public let loadMore: (() -> Void)?
|
||||||
public let chatPeerId: PeerId?
|
public let chatPeerId: EnginePeer.Id?
|
||||||
public let peekBehavior: EmojiContentPeekBehavior?
|
public let peekBehavior: EmojiContentPeekBehavior?
|
||||||
public let customLayout: CustomLayout?
|
public let customLayout: CustomLayout?
|
||||||
public let externalBackground: ExternalBackground?
|
public let externalBackground: ExternalBackground?
|
||||||
|
|
@ -298,7 +297,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||||
externalCancel: (() -> Void)? = nil,
|
externalCancel: (() -> Void)? = nil,
|
||||||
onScroll: @escaping () -> Void,
|
onScroll: @escaping () -> Void,
|
||||||
loadMore: (() -> Void)? = nil,
|
loadMore: (() -> Void)? = nil,
|
||||||
chatPeerId: PeerId?,
|
chatPeerId: EnginePeer.Id?,
|
||||||
peekBehavior: EmojiContentPeekBehavior?,
|
peekBehavior: EmojiContentPeekBehavior?,
|
||||||
customLayout: CustomLayout?,
|
customLayout: CustomLayout?,
|
||||||
externalBackground: ExternalBackground?,
|
externalBackground: ExternalBackground?,
|
||||||
|
|
@ -729,7 +728,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withSelectedItems(_ selectedItems: Set<MediaId>) -> EmojiPagerContentComponent {
|
public func withSelectedItems(_ selectedItems: Set<EngineMedia.Id>) -> EmojiPagerContentComponent {
|
||||||
return EmojiPagerContentComponent(
|
return EmojiPagerContentComponent(
|
||||||
id: self.id,
|
id: self.id,
|
||||||
context: self.context,
|
context: self.context,
|
||||||
|
|
@ -1746,7 +1745,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func animateInReactionSelection(sourceItems: [MediaId: (frame: CGRect, cornerRadius: CGFloat, frameIndex: Int, placeholder: UIImage)]) {
|
public func animateInReactionSelection(sourceItems: [EngineMedia.Id: (frame: CGRect, cornerRadius: CGFloat, frameIndex: Int, placeholder: UIImage)]) {
|
||||||
guard let component = self.component, let itemLayout = self.itemLayout else {
|
guard let component = self.component, let itemLayout = self.itemLayout else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -3858,7 +3857,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||||
}
|
}
|
||||||
var removedItemSelectionLayerIds: [EmojiKeyboardItemLayer.Key] = []
|
var removedItemSelectionLayerIds: [EmojiKeyboardItemLayer.Key] = []
|
||||||
for (id, itemSelectionLayer) in self.visibleItemSelectionLayers {
|
for (id, itemSelectionLayer) in self.visibleItemSelectionLayers {
|
||||||
var fileId: MediaId?
|
var fileId: EngineMedia.Id?
|
||||||
switch id.itemId {
|
switch id.itemId {
|
||||||
case let .animation(id):
|
case let .animation(id):
|
||||||
switch id {
|
switch id {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import AnimationCache
|
import AnimationCache
|
||||||
import MultiAnimationRenderer
|
import MultiAnimationRenderer
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -42,7 +41,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
||||||
|
|
||||||
private let context: AccountContext
|
private let context: AccountContext
|
||||||
private let forceTheme: PresentationTheme?
|
private let forceTheme: PresentationTheme?
|
||||||
private var initialFocusId: ItemCollectionId?
|
private var initialFocusId: EngineItemCollectionId?
|
||||||
private let hasPremiumForUse: Bool
|
private let hasPremiumForUse: Bool
|
||||||
private let hasPremiumForInstallation: Bool
|
private let hasPremiumForInstallation: Bool
|
||||||
private let parentInputInteraction: EmojiPagerContentComponent.InputInteraction
|
private let parentInputInteraction: EmojiPagerContentComponent.InputInteraction
|
||||||
|
|
@ -73,7 +72,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
||||||
context: AccountContext,
|
context: AccountContext,
|
||||||
forceTheme: PresentationTheme?,
|
forceTheme: PresentationTheme?,
|
||||||
items: [FeaturedStickerPackItem],
|
items: [FeaturedStickerPackItem],
|
||||||
initialFocusId: ItemCollectionId?,
|
initialFocusId: EngineItemCollectionId?,
|
||||||
hasPremiumForUse: Bool,
|
hasPremiumForUse: Bool,
|
||||||
hasPremiumForInstallation: Bool,
|
hasPremiumForInstallation: Bool,
|
||||||
parentInputInteraction: EmojiPagerContentComponent.InputInteraction
|
parentInputInteraction: EmojiPagerContentComponent.InputInteraction
|
||||||
|
|
@ -263,7 +262,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
||||||
|
|
||||||
var items: [EmojiPagerContentComponent.Item] = []
|
var items: [EmojiPagerContentComponent.Item] = []
|
||||||
|
|
||||||
var existingIds = Set<MediaId>()
|
var existingIds = Set<EngineMedia.Id>()
|
||||||
for item in result {
|
for item in result {
|
||||||
if let itemFile = item.1 {
|
if let itemFile = item.1 {
|
||||||
if existingIds.contains(itemFile.fileId) {
|
if existingIds.contains(itemFile.fileId) {
|
||||||
|
|
@ -321,7 +320,7 @@ public final class EmojiSearchContent: ASDisplayNode, EntitySearchContainerNode
|
||||||
|> mapToSignal { files, isFinalResult -> Signal<(items: [EmojiPagerContentComponent.ItemGroup], isFinalResult: Bool), NoError> in
|
|> mapToSignal { files, isFinalResult -> Signal<(items: [EmojiPagerContentComponent.ItemGroup], isFinalResult: Bool), NoError> in
|
||||||
var items: [EmojiPagerContentComponent.Item] = []
|
var items: [EmojiPagerContentComponent.Item] = []
|
||||||
|
|
||||||
var existingIds = Set<MediaId>()
|
var existingIds = Set<EngineMedia.Id>()
|
||||||
for itemFile in files {
|
for itemFile in files {
|
||||||
if existingIds.contains(itemFile.fileId) {
|
if existingIds.contains(itemFile.fileId) {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import ComponentFlow
|
||||||
import PagerComponent
|
import PagerComponent
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import BundleIconComponent
|
import BundleIconComponent
|
||||||
import AudioToolbox
|
import AudioToolbox
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import ComponentFlow
|
||||||
import PagerComponent
|
import PagerComponent
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import AnimationCache
|
import AnimationCache
|
||||||
import MultiAnimationRenderer
|
import MultiAnimationRenderer
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import ComponentFlow
|
||||||
import PagerComponent
|
import PagerComponent
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import MultiAnimationRenderer
|
import MultiAnimationRenderer
|
||||||
import AnimationCache
|
import AnimationCache
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
@ -248,7 +247,7 @@ public final class GifPagerContentComponent: Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate enum ItemKey: Hashable {
|
fileprivate enum ItemKey: Hashable {
|
||||||
case media(MediaId)
|
case media(EngineMedia.Id)
|
||||||
case placeholder(Int)
|
case placeholder(Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ public func paneGifSearchForQuery(context: AccountContext, query: String, offset
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: uniqueId ?? 0), partialReference: nil, resource: resource, previewRepresentations: previews, videoThumbnails: videoThumbnails, immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.Animated, .Video(duration: 0, size: dimensions, flags: [], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: [])
|
let file = TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: uniqueId ?? 0), partialReference: nil, resource: resource, previewRepresentations: previews, videoThumbnails: videoThumbnails, immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.Animated, .Video(duration: 0, size: dimensions, flags: [], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: [])
|
||||||
references.append(MultiplexedVideoNodeFile(file: FileMediaReference.standalone(media: file), contextResult: (collection, result)))
|
references.append(MultiplexedVideoNodeFile(file: FileMediaReference.standalone(media: file), contextResult: (collection, result)))
|
||||||
}
|
}
|
||||||
case let .internalReference(internalReference):
|
case let .internalReference(internalReference):
|
||||||
|
|
@ -339,7 +339,7 @@ public final class GifContext {
|
||||||
gifItems = combineLatest(hasRecentGifs, paneGifSearchForQuery(context: context, query: query.joined(separator: ""), offset: token, incompleteResults: true, staleCachedResults: true, delayRequest: false, updateActivity: nil), searchCategories)
|
gifItems = combineLatest(hasRecentGifs, paneGifSearchForQuery(context: context, query: query.joined(separator: ""), offset: token, incompleteResults: true, staleCachedResults: true, delayRequest: false, updateActivity: nil), searchCategories)
|
||||||
|> map { hasRecentGifs, result, searchCategories -> EntityKeyboardGifContent in
|
|> map { hasRecentGifs, result, searchCategories -> EntityKeyboardGifContent in
|
||||||
var items: [GifPagerContentComponent.Item] = []
|
var items: [GifPagerContentComponent.Item] = []
|
||||||
var existingIds = Set<MediaId>()
|
var existingIds = Set<EngineMedia.Id>()
|
||||||
for item in componentValue.component.items {
|
for item in componentValue.component.items {
|
||||||
items.append(item)
|
items.append(item)
|
||||||
existingIds.insert(item.file.media.fileId)
|
existingIds.insert(item.file.media.fileId)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import Photos
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
@ -205,7 +204,7 @@ final class ForumSettingsScreenComponent: Component {
|
||||||
return context.engine.peers.setChannelForumMode(id: upgradedPeerId, isForum: true, displayForumAsTabs: mode == .tabs)
|
return context.engine.peers.setChannelForumMode(id: upgradedPeerId, isForum: true, displayForumAsTabs: mode == .tabs)
|
||||||
})
|
})
|
||||||
|> map(Optional.init)
|
|> map(Optional.init)
|
||||||
|> `catch` { [weak self] error -> Signal<PeerId?, NoError> in
|
|> `catch` { [weak self] error -> Signal<EnginePeer.Id?, NoError> in
|
||||||
guard let self, let controller = self.environment?.controller() else {
|
guard let self, let controller = self.environment?.controller() else {
|
||||||
return .single(nil)
|
return .single(nil)
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +220,7 @@ final class ForumSettingsScreenComponent: Component {
|
||||||
}
|
}
|
||||||
return .single(nil)
|
return .single(nil)
|
||||||
}
|
}
|
||||||
|> mapToSignal { upgradedPeerId -> Signal<PeerId?, NoError> in
|
|> mapToSignal { upgradedPeerId -> Signal<EnginePeer.Id?, NoError> in
|
||||||
guard let upgradedPeerId = upgradedPeerId else {
|
guard let upgradedPeerId = upgradedPeerId else {
|
||||||
return .single(nil)
|
return .single(nil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import AppBundle
|
import AppBundle
|
||||||
import LocalMediaResources
|
import LocalMediaResources
|
||||||
|
|
@ -367,7 +366,7 @@ private final class CraftGiftPageContent: Component {
|
||||||
|
|
||||||
let anvilPath = getAppBundle().url(forResource: "Anvil", withExtension: "tgs")?.path ?? ""
|
let anvilPath = getAppBundle().url(forResource: "Anvil", withExtension: "tgs")?.path ?? ""
|
||||||
let anvilFile = TelegramMediaFile(
|
let anvilFile = TelegramMediaFile(
|
||||||
fileId: MediaId(namespace: Namespaces.Media.CloudFile, id: -123456789),
|
fileId: EngineMedia.Id(namespace: Namespaces.Media.CloudFile, id: -123456789),
|
||||||
partialReference: nil,
|
partialReference: nil,
|
||||||
resource: BundleResource(name: "Anvil", path: anvilPath),
|
resource: BundleResource(name: "Anvil", path: anvilPath),
|
||||||
previewRepresentations: [],
|
previewRepresentations: [],
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ swift_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/ComponentFlow",
|
"//submodules/ComponentFlow",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ swift_library(
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/AccountContext",
|
"//submodules/AccountContext",
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/Components/ComponentDisplayAdapters",
|
"//submodules/Components/ComponentDisplayAdapters",
|
||||||
"//submodules/TelegramUIPreferences",
|
"//submodules/TelegramUIPreferences",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
import TelegramStringFormatting
|
import TelegramStringFormatting
|
||||||
|
|
@ -102,7 +101,7 @@ final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||||
private let avatarsContext: AnimatedAvatarSetContext
|
private let avatarsContext: AnimatedAvatarSetContext
|
||||||
private var avatarsContent: AnimatedAvatarSetContext.Content?
|
private var avatarsContent: AnimatedAvatarSetContext.Content?
|
||||||
private let avatarsNode: AnimatedAvatarSetNode
|
private let avatarsNode: AnimatedAvatarSetNode
|
||||||
private var audioLevelGenerators: [PeerId: FakeAudioLevelGenerator] = [:]
|
private var audioLevelGenerators: [EnginePeer.Id: FakeAudioLevelGenerator] = [:]
|
||||||
private var audioLevelGeneratorTimer: SwiftSignalKit.Timer?
|
private var audioLevelGeneratorTimer: SwiftSignalKit.Timer?
|
||||||
|
|
||||||
private let backgroundNode: ASDisplayNode
|
private let backgroundNode: ASDisplayNode
|
||||||
|
|
@ -546,7 +545,7 @@ final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||||
self.audioLevelGenerators[peerId] = FakeAudioLevelGenerator()
|
self.audioLevelGenerators[peerId] = FakeAudioLevelGenerator()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var removeGenerators: [PeerId] = []
|
var removeGenerators: [EnginePeer.Id] = []
|
||||||
for peerId in self.audioLevelGenerators.keys {
|
for peerId in self.audioLevelGenerators.keys {
|
||||||
if !data.activeSpeakers.contains(peerId) {
|
if !data.activeSpeakers.contains(peerId) {
|
||||||
removeGenerators.append(peerId)
|
removeGenerators.append(peerId)
|
||||||
|
|
@ -571,7 +570,7 @@ final class GroupCallNavigationAccessoryPanel: ASDisplayNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func sampleAudioGenerators() {
|
private func sampleAudioGenerators() {
|
||||||
var levels: [PeerId: Float] = [:]
|
var levels: [EnginePeer.Id: Float] = [:]
|
||||||
for (peerId, generator) in self.audioLevelGenerators {
|
for (peerId, generator) in self.audioLevelGenerators {
|
||||||
levels[peerId] = generator.get()
|
levels[peerId] = generator.get()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ swift_library(
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/Display",
|
"//submodules/Display",
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/Postbox",
|
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramPresentationData",
|
"//submodules/TelegramPresentationData",
|
||||||
"//submodules/MediaResources",
|
"//submodules/MediaResources",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import MediaResources
|
import MediaResources
|
||||||
|
|
@ -133,7 +132,7 @@ public func legacyInputMicPalette(from theme: PresentationTheme) -> TGModernConv
|
||||||
return TGModernConversationInputMicPallete(dark: theme.overallDarkAppearance, buttonColor: inputPanelTheme.actionControlFillColor, iconColor: inputPanelTheme.actionControlForegroundColor, backgroundColor: theme.rootController.navigationBar.opaqueBackgroundColor, borderColor: inputPanelTheme.panelSeparatorColor, lock: inputPanelTheme.panelControlAccentColor, textColor: inputPanelTheme.primaryTextColor, secondaryTextColor: inputPanelTheme.secondaryTextColor, recording: inputPanelTheme.mediaRecordingDotColor)
|
return TGModernConversationInputMicPallete(dark: theme.overallDarkAppearance, buttonColor: inputPanelTheme.actionControlFillColor, iconColor: inputPanelTheme.actionControlForegroundColor, backgroundColor: theme.rootController.navigationBar.opaqueBackgroundColor, borderColor: inputPanelTheme.panelSeparatorColor, lock: inputPanelTheme.panelControlAccentColor, textColor: inputPanelTheme.primaryTextColor, secondaryTextColor: inputPanelTheme.secondaryTextColor, recording: inputPanelTheme.mediaRecordingDotColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func legacyInstantVideoController(theme: PresentationTheme, forStory: Bool, panelFrame: CGRect, context: AccountContext, peerId: PeerId, slowmodeState: ChatSlowmodeState?, hasSchedule: Bool, send: @escaping (InstantVideoController, EnqueueMessage?) -> Void, displaySlowmodeTooltip: @escaping (UIView, CGRect) -> Void, presentSchedulePicker: @escaping (@escaping (Int32, Bool) -> Void) -> Void) -> InstantVideoController {
|
public func legacyInstantVideoController(theme: PresentationTheme, forStory: Bool, panelFrame: CGRect, context: AccountContext, peerId: EnginePeer.Id, slowmodeState: ChatSlowmodeState?, hasSchedule: Bool, send: @escaping (InstantVideoController, EnqueueMessage?) -> Void, displaySlowmodeTooltip: @escaping (UIView, CGRect) -> Void, presentSchedulePicker: @escaping (@escaping (Int32, Bool) -> Void) -> Void) -> InstantVideoController {
|
||||||
let isSecretChat = peerId.namespace == Namespaces.Peer.SecretChat
|
let isSecretChat = peerId.namespace == Namespaces.Peer.SecretChat
|
||||||
|
|
||||||
let legacyController = InstantVideoController(presentation: .custom, theme: theme)
|
let legacyController = InstantVideoController(presentation: .custom, theme: theme)
|
||||||
|
|
@ -203,8 +202,8 @@ public func legacyInstantVideoController(theme: PresentationTheme, forStory: Boo
|
||||||
}
|
}
|
||||||
|
|
||||||
if let dict = adjustments.dictionary(), let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false) {
|
if let dict = adjustments.dictionary(), let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false) {
|
||||||
let adjustmentsData = MemoryBuffer(data: data)
|
let adjustmentsData = EngineMemoryBuffer(data: data)
|
||||||
let digest = MemoryBuffer(data: adjustmentsData.md5Digest())
|
let digest = EngineMemoryBuffer(data: adjustmentsData.md5Digest())
|
||||||
resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false)
|
resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -222,16 +221,16 @@ public func legacyInstantVideoController(theme: PresentationTheme, forStory: Boo
|
||||||
}
|
}
|
||||||
|
|
||||||
if let previewImage = previewImage {
|
if let previewImage = previewImage {
|
||||||
let tempFile = TempBox.shared.tempFile(fileName: "file")
|
let tempFile = EngineTempBox.shared.tempFile(fileName: "file")
|
||||||
defer {
|
defer {
|
||||||
TempBox.shared.dispose(tempFile)
|
EngineTempBox.shared.dispose(tempFile)
|
||||||
}
|
}
|
||||||
if let data = compressImageToJPEG(previewImage, quality: 0.7, tempFilePath: tempFile.path) {
|
if let data = compressImageToJPEG(previewImage, quality: 0.7, tempFilePath: tempFile.path) {
|
||||||
context.account.postbox.mediaBox.storeCachedResourceRepresentation(resource, representation: CachedVideoFirstFrameRepresentation(), data: data)
|
context.account.postbox.mediaBox.storeCachedResourceRepresentation(resource, representation: CachedVideoFirstFrameRepresentation(), data: data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let media = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: Int64.random(in: Int64.min ... Int64.max)), partialReference: nil, resource: resource, previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.FileName(fileName: "video.mp4"), .Video(duration: finalDuration, size: PixelDimensions(finalDimensions), flags: [.instantRoundVideo], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: [])
|
let media = TelegramMediaFile(fileId: EngineMedia.Id(namespace: Namespaces.Media.LocalFile, id: Int64.random(in: Int64.min ... Int64.max)), partialReference: nil, resource: resource, previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: "video/mp4", size: nil, attributes: [.FileName(fileName: "video.mp4"), .Video(duration: finalDuration, size: PixelDimensions(finalDimensions), flags: [.instantRoundVideo], preloadSize: nil, coverTime: nil, videoCodec: nil)], alternativeRepresentations: [])
|
||||||
var message: EnqueueMessage = .message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
var message: EnqueueMessage = .message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: nil, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||||
|
|
||||||
let scheduleTime: Int32? = scheduleTimestamp > 0 ? scheduleTimestamp : nil
|
let scheduleTime: Int32? = scheduleTimestamp > 0 ? scheduleTimestamp : nil
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue