Little refactor

This commit is contained in:
ivan2282
2025-12-10 17:34:10 +03:00
parent ecdb34505c
commit bdea92a61b
35 changed files with 74 additions and 30 deletions

View File

@@ -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 не найдена, пробуем альтернативные имена...',

View File

@@ -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;

View File

@@ -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, {});
}

View File

@@ -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,

View File

@@ -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,

View File

@@ -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': 'Твоя сессия больше не активна, войди снова',

View File

@@ -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();

View File

@@ -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,

View File

@@ -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;

View File

@@ -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>{

View File

@@ -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');

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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]!;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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,

View File

@@ -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(),

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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'),

View File

@@ -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 =

View File

@@ -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);

View File

@@ -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),

View File

@@ -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, {

View File

@@ -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;

View File

@@ -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();

View File

@@ -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});

View File

@@ -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) {