ZaStoGram/TMessagesProj/jni/mtproxy/MtProxyProbeLease.cpp
loop-uh 8a5c466c82 Refactor MTProxy recorder and emoji animation scheduler
Extract MTProxy endpoint recording logic into MtProxyEndpointRecorder and MtProxyProbeLease helper classes, and introduce EmojiPanelAnimationScheduler for controlled animation playback in emoji panels.

Key changes:
- Move endpoint failure/handshake/data-path recording from ConnectionSocket to MtProxyEndpointRecorder
- Replace probe lease management methods with MtProxyProbeLease member class
- Add EmojiPanelAnimationScheduler to manage GIF/sticker playback based on visibility and scroll state
- Add animation FPS limiting and invalidation delegate hooks to ImageReceiver
- Update Java proxy event handling to route connected/connect_start/usable_success through ProxyEventReducer
- Update verification tools to reflect new architecture
2026-07-02 21:01:55 +03:00

34 lines
811 B
C++

#include "MtProxyProbeLease.h"
bool MtProxyProbeLease::active() const {
return token != 0 && !probeKey.key.empty();
}
uint64_t MtProxyProbeLease::ownerToken() const {
return token;
}
const std::string &MtProxyProbeLease::key() const {
return probeKey.key;
}
void MtProxyProbeLease::acquire(const MtProxyProbeCoordinator::ProbeKey &capturedProbeKey, uint64_t ownerToken) {
release();
probeKey = capturedProbeKey;
token = ownerToken;
}
void MtProxyProbeLease::release() {
if (active()) {
MtProxyProbeCoordinator::cancelOwner(probeKey, token);
}
token = 0;
probeKey = MtProxyProbeCoordinator::ProbeKey();
}
void MtProxyProbeLease::touch(int64_t now) {
if (!active()) {
return;
}
MtProxyProbeCoordinator::touchOwner(probeKey, token, now);
}