Little refactor
This commit is contained in:
@@ -58,6 +58,8 @@ class RegistrationService {
|
||||
)
|
||||
.asFunction();
|
||||
print('✅ LZ4 block decompress функция загружена');
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
} catch (e) {
|
||||
print(
|
||||
'⚠️ Функция LZ4_decompress_safe не найдена, пробуем альтернативные имена...',
|
||||
|
||||
@@ -147,7 +147,8 @@ class ApiService {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Completer<Map<String, dynamic>>? _inflightChatsCompleter;
|
||||
Map<String, dynamic>? _lastChatsPayload;
|
||||
DateTime? _lastChatsAt;
|
||||
|
||||
@@ -36,7 +36,8 @@ extension ApiServiceAuth on ApiService {
|
||||
};
|
||||
_sendMessage(17, payload);
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
void requestSessions() {
|
||||
_sendMessage(96, {});
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ extension ApiServiceChats on ApiService {
|
||||
if (chatResponse['cmd'] == 1) {
|
||||
print("✅ Авторизация (opcode 19) успешна. Сессия ГОТОВА.");
|
||||
_isSessionReady = true;
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
_connectionStatusController.add("ready");
|
||||
_updateConnectionState(
|
||||
conn_state.ConnectionState.ready,
|
||||
|
||||
@@ -7,7 +7,8 @@ extension ApiServiceComplaints on ApiService {
|
||||
final payload = {"complainSync": 0};
|
||||
_sendMessage(162, payload);
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
void sendComplaint(int chatId, String messageId, int typeId, int reasonId) {
|
||||
final payload = {
|
||||
"reasonId": reasonId,
|
||||
|
||||
@@ -123,7 +123,8 @@ extension ApiServiceConnection on ApiService {
|
||||
authToken = null;
|
||||
|
||||
clearAllCaches();
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
_messageController.add({
|
||||
'type': 'session_terminated',
|
||||
'message': 'Твоя сессия больше не активна, войди снова',
|
||||
|
||||
@@ -46,7 +46,8 @@ extension ApiServiceContacts on ApiService {
|
||||
};
|
||||
_sendMessage(54, payload);
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Future<Map<String, dynamic>> getChatInfoByLink(String link) async {
|
||||
await waitUntilOnline();
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ extension ApiServiceMedia on ApiService {
|
||||
) async {
|
||||
try {
|
||||
await waitUntilOnline();
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
final Map<String, dynamic> payload = {
|
||||
"firstName": firstName,
|
||||
"lastName": lastName,
|
||||
|
||||
@@ -28,7 +28,8 @@ extension ApiServicePrivacy on ApiService {
|
||||
}
|
||||
if (incomingCall != null) {
|
||||
final seq = incomingCall == 'ALL' ? 30 : 23;
|
||||
await _updatePrivacySettingWithSeq({'INCOMING_CALL': incomingCall}, seq);
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI await _updatePrivacySettingWithSeq({'INCOMING_CALL': incomingCall}, seq);
|
||||
}
|
||||
if (chatsInvite != null) {
|
||||
final seq = chatsInvite == 'ALL' ? 51 : 55;
|
||||
|
||||
@@ -159,7 +159,8 @@ class ConnectionLogger {
|
||||
data: data,
|
||||
);
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
void logState(String from, String to, {Map<String, dynamic>? metadata}) {
|
||||
final data = <String, dynamic>{
|
||||
|
||||
@@ -83,7 +83,8 @@ class ConnectionManager {
|
||||
|
||||
bool get canSendMessages => currentState.canSendMessages;
|
||||
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Future<void> initialize() async {
|
||||
if (_isDisposed) {
|
||||
_logger.logError('Попытка инициализации после dispose');
|
||||
|
||||
@@ -85,7 +85,8 @@ class ConnectionManagerSimple {
|
||||
|
||||
|
||||
bool get canSendMessages => currentState.canSendMessages;
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
Future<void> initialize() async {
|
||||
if (_isDisposed) {
|
||||
|
||||
@@ -25,7 +25,8 @@ enum ConnectionState {
|
||||
|
||||
disabled,
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
class ConnectionInfo {
|
||||
final ConnectionState state;
|
||||
|
||||
@@ -62,7 +62,8 @@ class HealthMetrics {
|
||||
return max(0, score);
|
||||
}
|
||||
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
ConnectionQuality get quality {
|
||||
final score = healthScore;
|
||||
if (score >= 90) return ConnectionQuality.excellent;
|
||||
|
||||
@@ -119,7 +119,8 @@ class RetryStrategy {
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Duration calculateDelay(int attempt, ErrorType errorType) {
|
||||
final config = errorConfigs[errorType] ?? errorConfigs[ErrorType.unknown]!;
|
||||
|
||||
|
||||
@@ -105,3 +105,5 @@ class Account {
|
||||
);
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -115,3 +115,5 @@ class AttachmentsParser {
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -38,3 +38,5 @@ class Channel {
|
||||
);
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -108,3 +108,5 @@ class Chat {
|
||||
);
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -83,3 +83,5 @@ class ChatFolderWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -45,3 +45,5 @@ class ComplaintData {
|
||||
);
|
||||
}
|
||||
}
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@@ -52,7 +52,8 @@ class Contact {
|
||||
final isBlocked = status == 'BLOCKED';
|
||||
|
||||
final isBlockedByMe = status == 'BLOCKED';
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
return Contact(
|
||||
id: json['id'],
|
||||
name: finalName,
|
||||
|
||||
@@ -41,7 +41,8 @@ class Message {
|
||||
} else {
|
||||
time = 0;
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
return Message(
|
||||
id:
|
||||
json['id']?.toString() ??
|
||||
@@ -115,7 +116,8 @@ class Message {
|
||||
|
||||
return hoursSinceCreation <= 24;
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
|
||||
@@ -39,7 +39,8 @@ class Profile {
|
||||
|
||||
final names = profileData['names'] as List<dynamic>? ?? [];
|
||||
final nameData = names.isNotEmpty ? names[0] as Map<String, dynamic> : {};
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
return Profile(
|
||||
id: profileData['id'],
|
||||
phone: profileData['phone'].toString(),
|
||||
|
||||
@@ -4769,7 +4769,8 @@ class _SferumWebViewPanelState extends State<SferumWebViewPanel> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
class _AddChatsToFolderDialog extends StatefulWidget {
|
||||
final ChatFolder folder;
|
||||
final List<Chat> availableChats;
|
||||
|
||||
@@ -100,7 +100,8 @@ class _CustomRequestScreenState extends State<CustomRequestScreen> {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
subscription = ApiService.instance.messages.listen((message) {
|
||||
|
||||
if (message['seq'] == sentSeq) {
|
||||
|
||||
@@ -16,7 +16,8 @@ class DebugScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final theme = context.watch<ThemeProvider>();
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Debug Settings'),
|
||||
|
||||
@@ -167,7 +167,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
Future<void> _checkVersionInBackground() async {
|
||||
try {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
@@ -178,7 +179,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
if (!isWebVersionCheckEnabled) {
|
||||
print("Web version checking is disabled, skipping check");
|
||||
return;
|
||||
}
|
||||
}// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
final isAutoUpdateEnabled = prefs.getBool('auto_update_enabled') ?? false;
|
||||
final showUpdateNotification =
|
||||
|
||||
@@ -122,7 +122,8 @@ class _MusicLibraryScreenState extends State<MusicLibraryScreen> {
|
||||
final seconds = duration.inSeconds.remainder(60);
|
||||
return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
@@ -85,7 +85,8 @@ class _PasswordAuthScreenState extends State<PasswordAuthScreen> {
|
||||
errorMessage = error['message'];
|
||||
}
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(errorMessage),
|
||||
|
||||
@@ -17,7 +17,8 @@ class AboutScreen extends StatelessWidget {
|
||||
print('Could not launch $url');
|
||||
}
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
Widget _buildTeamMember(
|
||||
BuildContext context, {
|
||||
|
||||
@@ -75,7 +75,8 @@ class _QrLoginScreenState extends State<QrLoginScreen> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
|
||||
void _regenerateQrData() {
|
||||
if (_token == null) return;
|
||||
|
||||
@@ -22,7 +22,8 @@ class _ReconnectionScreenState extends State<ReconnectionScreen> {
|
||||
_startFullReconnection();
|
||||
_listenToApiMessages();
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
@override
|
||||
void dispose() {
|
||||
_apiSubscription?.cancel();
|
||||
|
||||
@@ -25,7 +25,8 @@ class LogEntry {
|
||||
required this.type,
|
||||
});
|
||||
}
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
class SocketLogScreen extends StatefulWidget {
|
||||
const SocketLogScreen({super.key});
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ class _TokenAuthScreenState extends State<TokenAuthScreen> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
|
||||
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI
|
||||
void _loginWithToken() {
|
||||
final token = _tokenController.text.trim();
|
||||
if (token.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user