ZaStoGram/TMessagesProj/jni/mtproxy/MtProxySocketPublisher.h
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

35 lines
1.3 KiB
C++

#ifndef MTPROXYSOCKETPUBLISHER_H
#define MTPROXYSOCKETPUBLISHER_H
#include "MtProxyPhaseContract.h"
#include <functional>
#include <string>
struct MtProxySocketObservation {
const char *phase = MtProxyPhase::ConnectionNotStarted;
const char *reason = "unknown";
std::string endpointKey;
std::string probeKey;
std::string networkEndpointKey;
bool publishVisibleStage = true;
bool recordEndpointFailure = false;
};
struct MtProxySocketPublisherCallbacks {
std::function<void(const MtProxySocketObservation &observation)> publishVisibleStage;
std::function<void(const MtProxySocketObservation &observation)> recordEndpointFailure;
};
struct MtProxySocketPublisherContext {
std::string endpointKey;
std::string probeKey;
std::string networkEndpointKey;
};
MtProxySocketObservation mtProxyNormalizeSocketObservation(const MtProxySocketObservation &observation);
void mtProxyPublishSocketObservation(const MtProxySocketObservation &observation, const MtProxySocketPublisherCallbacks &callbacks);
void mtProxyPublishSocketObservation(const MtProxySocketObservation &observation, const MtProxySocketPublisherContext &context, const MtProxySocketPublisherCallbacks &callbacks);
bool mtProxySocketObservationIsHighRiskPhase(const char *phase);
#endif