Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
￴￴ committed Aug 30, 2024
1 parent 8828b2e commit 7789420
Show file tree
Hide file tree
Showing 42 changed files with 917 additions and 374 deletions.
4 changes: 2 additions & 2 deletions bin/replace/update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import "package:path/path.dart" as path;
import "package:yaml/yaml.dart" as yaml;
import "package:yaml_writer/yaml_writer.dart";

String version_package = "0.8.22";
String version_package = "0.8.23";
Future<void> pubspecUpdate({
required File filePubspec,
}) async {
Expand All @@ -65,7 +65,7 @@ Future<void> pubspecUpdate({
"version": version_package,
"repository": "https://github.com/azkadev/telegram_client.git",
"homepage": "https://github.com/azkadev/telegram_client",
"issue_tracker": "https://github.com/azkadev/telegram_client/issues",
"issue_tracker": "https://t.me/DEVELOPER_GLOBAL_PUBLIC",
"documentation": "https://github.com/azkadev/telegram_client/tree/main/docs",
"funding": [
"https://github.com/sponsors/azkadev",
Expand Down
4 changes: 2 additions & 2 deletions package/mtproto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.8.22
## 0.8.23

- Update: 2024-08-01 04:26:35.969422 - update librarry.
- Update: 2024-08-30 14:33:46.233206 - update librarry.
4 changes: 2 additions & 2 deletions package/mtproto/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'mtproto'
description: 'Telegram Client Lightweight, blazing and Highly customizable for make application telegram based tdlib, mtproto, or bot api and support server side.'
version: '0.8.22'
version: '0.8.23'
homepage: 'https://github.com/azkadev/telegram_client'
repository: 'https://github.com/azkadev/telegram_client.git'
issue_tracker: 'https://github.com/azkadev/telegram_client/issues'
issue_tracker: 'https://t.me/DEVELOPER_GLOBAL_PUBLIC'
documentation: 'https://github.com/azkadev/telegram_client/tree/main/docs'
funding:
- 'https://github.com/sponsors/azkadev'
Expand Down
4 changes: 2 additions & 2 deletions package/telegram_client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.8.22
## 0.8.23

- Update: 2024-08-01 04:26:35.980408 - update librarry.
- Update: 2024-08-30 14:33:46.242320 - update librarry.
29 changes: 20 additions & 9 deletions package/telegram_client/lib/mtproto/mtproto_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class Mtproto {
'system_language_code': 'en',
'new_verbosity_level': 0,
'application_version': 'v1',
'device_model': 'VGVsZWdyYW0gQ2xpZW50IEFaS0FERVYgR0xPQkFMIENPUlBPUkFUSU9O'.general_lib_utils_decryptFromBase64(),
'device_model': 'VGVsZWdyYW0gQ2xpZW50IEFaS0FERVYgR0xPQkFMIENPUlBPUkFUSU9O'
.general_lib_utils_decryptFromBase64(),
'system_version': Platform.operatingSystemVersion,
"database_key": "",
"start": true,
Expand All @@ -95,8 +96,10 @@ class Mtproto {
Duration invoke_time_out = Duration(minutes: 10);
late double timeOutUpdate;
FutureOr<void> Function(dynamic update, Mtproto Mtproto)? on_receive_update;
FutureOr<String> Function(int client_id, Mtproto Mtproto)? on_generate_extra_invoke;
FutureOr<Map> Function(String extra, int client_id, Mtproto Mtproto)? on_get_invoke_data;
FutureOr<String> Function(int client_id, Mtproto Mtproto)?
on_generate_extra_invoke;
FutureOr<Map> Function(String extra, int client_id, Mtproto Mtproto)?
on_get_invoke_data;
Mtproto({
String? pathTdl,
Map? clientOption,
Expand Down Expand Up @@ -146,7 +149,8 @@ class Mtproto {
} else if (update is MtprotoIsolateReceiveDataError) {
MtprotoIsolateReceiveDataError tdlibIsolateReceiveDataError = update;
try {
MtprotoClient? tdlibClient = clients.getClientById(tdlibIsolateReceiveDataError.clientId);
MtprotoClient? tdlibClient =
clients.getClientById(tdlibIsolateReceiveDataError.clientId);
if (tdlibClient != null) {
tdlibClient.close();
}
Expand Down Expand Up @@ -298,11 +302,14 @@ class Mtproto {
}

/// receive all update data
EventEmitterListener on(String type_update, FutureOr<dynamic> Function(UpdateMt update) callback, {void Function(Object data)? onError}) {
EventEmitterListener on(
String type_update, FutureOr<dynamic> Function(UpdateMt update) callback,
{void Function(Object data)? onError}) {
return event_emitter.on(type_update, null, (Event ev, context) async {
try {
if (ev.eventData is MtprotoIsolateReceiveData) {
MtprotoIsolateReceiveData tdlibIsolateReceiveData = (ev.eventData as MtprotoIsolateReceiveData);
MtprotoIsolateReceiveData tdlibIsolateReceiveData =
(ev.eventData as MtprotoIsolateReceiveData);
await callback(UpdateMt(
update: tdlibIsolateReceiveData.updateData,
client_id: tdlibIsolateReceiveData.clientId,
Expand Down Expand Up @@ -338,8 +345,10 @@ class Mtproto {
Duration? invokeTimeOut,
String? extra,
bool? iSAutoGetChat,
FutureOr<String> Function(int client_id, Mtproto Mtproto)? onGenerateExtraInvoke,
FutureOr<Map> Function(String extra, int client_id, Mtproto Mtproto)? onGetInvokeData,
FutureOr<String> Function(int client_id, Mtproto Mtproto)?
onGenerateExtraInvoke,
FutureOr<Map> Function(String extra, int client_id, Mtproto Mtproto)?
onGetInvokeData,
bool isThrowOnError = true,
}) async {
onGetInvokeData ??= on_get_invoke_data;
Expand Down Expand Up @@ -380,7 +389,9 @@ class Mtproto {
parameters["@extra"] = generateUuid(15);
}

if (iSAutoGetChat && RegExp(r"^(sendMessage|getChatMember)$", caseSensitive: false).hashData(method)) {
if (iSAutoGetChat &&
RegExp(r"^(sendMessage|getChatMember)$", caseSensitive: false)
.hashData(method)) {
if (parameters["chat_id"] is int) {
client_send(
clientId,
Expand Down
Loading

0 comments on commit 7789420

Please sign in to comment.