diff --git a/README.md b/README.md
index 063a063a..021bec54 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Async echo](https://docs.madelineproto.xyz/docs/ASYNC.html#async-echo-does-not-block-the-main-thread)
* [MadelineProto artax HTTP client](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-artax-http-client)
* [Async forking](https://docs.madelineproto.xyz/docs/ASYNC.html#async-forking-does-green-thread-forking)
+ * [Async flock](https://docs.madelineproto.xyz/docs/ASYNC.html#async-flock)
* [Combining async operations](https://docs.madelineproto.xyz/docs/ASYNC.html#combining-async-operations)
* [MadelineProto async loop APIs](https://docs.madelineproto.xyz/docs/ASYNC.html#async-loop-apis)
* [Loop](https://docs.madelineproto.xyz/docs/ASYNC.html#loop)
@@ -174,12 +175,14 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Make a phone call and play a song](https://docs.madelineproto.xyz/docs/CALLS.html)
* [Create a secret chat bot](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html)
* Accept URL authorization: messages.acceptUrlAuth
+ * Accept contact: contacts.acceptContact
* Accept telegram passport authorization: account.acceptAuthorization
* Accept telegram's TOS: help.acceptTermsOfService
* Add a sticker set: messages.installStickerSet
* Add a sticker to favorites: messages.faveSticker
* Add a sticker to recent stickers: messages.saveRecentSticker
* Add a user to a normal chat (use channels->inviteToChannel for supergroups): messages.addChatUser
+ * Add contact: contacts.addContact
* Add phone number as contact: contacts.importContacts
* Add sticker to stickerset: stickers.addStickerToSet
* Add users to channel/supergroup: channels.inviteToChannel
@@ -215,7 +218,6 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* Delete a certain session: account.resetAuthorization
* Delete a certain telegram web login authorization: account.resetWebAuthorization
* Delete a channel/supergroup: channels.deleteChannel
- * Delete a contact: contacts.deleteContact
* Delete a user from a chat (not supergroup): messages.deleteChatUser
* Delete all logged-in sessions.: auth.resetAuthorizations
* Delete all messages of a user in a channel/supergroup: channels.deleteUserHistory
@@ -237,8 +239,10 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* Edit admin permissions of a user in a channel/supergroup: channels.editAdmin
* Edit admin permissions: messages.editChatAdmin
* Edit chat info: messages.editChatAbout
+ * Edit creator of channel: channels.editCreator
* Edit default rights of chat: messages.editChatDefaultBannedRights
* Edit folder: folders.editPeerFolders
+ * Edit location (geochats): channels.editLocation
* Edit the photo of a normal chat (not supergroup): messages.editChatPhoto
* Edit the photo of a supergroup/channel: channels.editPhoto
* Edit the title of a normal chat (not supergroup): messages.editChatTitle
@@ -270,7 +274,6 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* Get call configuration: phone.getCallConfig
* Get channel/supergroup messages: channels.getMessages
* Get channel/supergroup participants (you should use `$MadelineProto->get_pwr_chat($id)` instead): channels.getParticipants
- * Get channels for discussion: channels.getBroadcastsForDiscussion
* Get chats in common with a user: messages.getCommonChats
* Get contacts by IDs: contacts.getContactIDs
* Get deep link info: help.getDeepLinkInfo
@@ -310,6 +313,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* Get passport config: help.getPassportConfig
* Get payment form: payments.getPaymentForm
* Get payment receipt: payments.getPaymentReceipt
+ * Get people nearby (geochats): contacts.getLocated
* Get pinned dialogs: messages.getPinnedDialogs
* Get poll results: messages.getPollResults
* Get previous messages of a group: messages.getHistory
@@ -343,7 +347,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* Get webpage preview: messages.getWebPagePreview
* Gets list of chats: you should use $MadelineProto->get_dialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html: messages.getDialogs
* Global message search: messages.searchGlobal
- * Hide report spam popup: messages.hideReportSpam
+ * Hide peer settings bar: messages.hidePeerSettingsBar
* Import chat invite: messages.importChatInvite
* Initializes connection and save information on the user's device and application.: initConnection
* Install wallpaper: account.installWallPaper
diff --git a/build_docs.php b/build_docs.php
index 1117db39..7705c57b 100755
--- a/build_docs.php
+++ b/build_docs.php
@@ -43,9 +43,9 @@ $docs = [
'readme' => false,
],
[
- 'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v100.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
- 'title' => 'MadelineProto API documentation (layer 100)',
- 'description' => 'MadelineProto API documentation (layer 100)',
+ 'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v102.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
+ 'title' => 'MadelineProto API documentation (layer 102)',
+ 'description' => 'MadelineProto API documentation (layer 102)',
'output_dir' => __DIR__.'/docs/docs/API_docs',
'readme' => false,
],
diff --git a/composer.json b/composer.json
index b9d36989..8453a124 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
"danog/magicalserializer": "^1.0",
"phpseclib/phpseclib": "dev-master#5e7d39153270dfd19d585504b0a29ac65a62adf9 as 2.0.15",
"vlucas/phpdotenv": "^3",
- "erusev/parsedown": "^1.6",
+ "erusev/parsedown": "^1.7",
"ext-mbstring": "*",
"ext-json": "*",
"ext-xml": "*",
diff --git a/docs b/docs
index 02967b30..cbd913fb 160000
--- a/docs
+++ b/docs
@@ -1 +1 @@
-Subproject commit 02967b3019032399364a9fc134f7bb0e674c099a
+Subproject commit cbd913fba2249a0055bb732452a67f911119c40a
diff --git a/layerdiff.php b/layerdiff.php
index 58f1dd19..32640022 100644
--- a/layerdiff.php
+++ b/layerdiff.php
@@ -50,6 +50,7 @@ function getUrl($constructor, $type)
{
$changed = str_replace('.', '_', $constructor);
+ return "[$constructor](https://github.com/danog/MadelineProtoDocs/blob/geochats/docs/API_docs/$type/$changed.md)";
return "[$constructor](https://docs.madelineproto.xyz/API_docs/$type/$changed.html)";
}
$old = getTL($argv[1]);
diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php
index 1d3912d1..9ff06eaa 100644
--- a/src/danog/MadelineProto/DocsBuilder/Methods.php
+++ b/src/danog/MadelineProto/DocsBuilder/Methods.php
@@ -270,8 +270,13 @@ The following tags are currently supported:
bold
italic
italic
+underline
+strikethrough
+strikethrough
+strikethrough
inline fixed-width code
pre-formatted fixed-width code block
+pre-formatted fixed-width code block
URL
Mention by username
Mention by user id
diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php
index c3f380ba..f78fe1cb 100644
--- a/src/danog/MadelineProto/InternalDoc.php
+++ b/src/danog/MadelineProto/InternalDoc.php
@@ -713,16 +713,7 @@ interface contacts
* InputUser id,
* ]
*
- * @return contacts_Link
- */
- public function deleteContact(array $params);
-
- /**
- * @param array params [
- * InputUser id,
- * ]
- *
- * @return bool
+ * @return Updates
*/
public function deleteContacts(array $params);
@@ -829,6 +820,37 @@ interface contacts
* @return bool
*/
public function toggleTopPeers(array $params);
+
+ /**
+ * @param array params [
+ * boolean add_phone_privacy_exception,
+ * InputUser id,
+ * string first_name,
+ * string last_name,
+ * string phone,
+ * ]
+ *
+ * @return Updates
+ */
+ public function addContact(array $params);
+
+ /**
+ * @param array params [
+ * InputUser id,
+ * ]
+ *
+ * @return Updates
+ */
+ public function acceptContact(array $params);
+
+ /**
+ * @param array params [
+ * InputGeoPoint geo_point,
+ * ]
+ *
+ * @return Updates
+ */
+ public function getLocated(array $params);
}
interface messages
@@ -1002,15 +1024,6 @@ interface messages
*/
public function reportSpam(array $params);
- /**
- * @param array params [
- * InputPeer peer,
- * ]
- *
- * @return bool
- */
- public function hideReportSpam(array $params);
-
/**
* @param array params [
* InputPeer peer,
@@ -1346,6 +1359,7 @@ interface messages
/**
* @param array params [
+ * int folder_id,
* string q,
* int offset_rate,
* InputPeer offset_peer,
@@ -2023,6 +2037,15 @@ interface messages
* @return UrlAuthResult
*/
public function acceptUrlAuth(array $params);
+
+ /**
+ * @param array params [
+ * InputPeer peer,
+ * ]
+ *
+ * @return bool
+ */
+ public function hidePeerSettingsBar(array $params);
}
interface updates
@@ -2430,6 +2453,8 @@ interface channels
* boolean megagroup,
* string title,
* string about,
+ * InputGeoPoint geo_point,
+ * string address,
* ]
*
* @return Updates
@@ -2546,9 +2571,14 @@ interface channels
public function toggleSignatures(array $params);
/**
+ * @param array params [
+ * boolean by_location,
+ * boolean check_limit,
+ * ]
+ *
* @return messages_Chats
*/
- public function getAdminedPublicChannels();
+ public function getAdminedPublicChannels(array $params);
/**
* @param array params [
@@ -2630,11 +2660,6 @@ interface channels
*/
public function getGroupsForDiscussion();
- /**
- * @return messages_Chats
- */
- public function getBroadcastsForDiscussion();
-
/**
* @param array params [
* InputChannel broadcast,
@@ -2644,6 +2669,28 @@ interface channels
* @return bool
*/
public function setDiscussionGroup(array $params);
+
+ /**
+ * @param array params [
+ * InputChannel channel,
+ * InputUser user_id,
+ * InputCheckPasswordSRP password,
+ * ]
+ *
+ * @return Updates
+ */
+ public function editCreator(array $params);
+
+ /**
+ * @param array params [
+ * InputChannel channel,
+ * InputGeoPoint geo_point,
+ * string address,
+ * ]
+ *
+ * @return bool
+ */
+ public function editLocation(array $params);
}
interface bots
diff --git a/src/danog/MadelineProto/Lang.php b/src/danog/MadelineProto/Lang.php
index fef06387..22cce396 100644
--- a/src/danog/MadelineProto/Lang.php
+++ b/src/danog/MadelineProto/Lang.php
@@ -5075,6 +5075,66 @@ class Lang
'object_urlAuthResultAccepted' => 'URL authorization accepted',
'object_urlAuthResultAccepted_param_url_type_string' => 'URL',
'object_urlAuthResultDefault' => 'Default result',
+ 'method_contacts.addContact' => 'Add contact',
+ 'method_contacts.addContact_param_add_phone_privacy_exception_type_true' => 'Phone privacy exception?',
+ 'method_contacts.addContact_param_id_type_InputUser' => 'ID',
+ 'method_contacts.addContact_param_first_name_type_string' => 'First name',
+ 'method_contacts.addContact_param_last_name_type_string' => 'Last name',
+ 'method_contacts.addContact_param_phone_type_string' => 'Phone number',
+ 'method_contacts.acceptContact' => 'Accept contact',
+ 'method_contacts.acceptContact_param_id_type_InputUser' => 'ID',
+ 'method_contacts.getLocated' => 'Get people nearby (geochats)',
+ 'method_contacts.getLocated_param_geo_point_type_InputGeoPoint' => 'Current location',
+ 'method_messages.searchGlobal_param_folder_id_type_int' => 'Folder ID',
+ 'method_messages.hidePeerSettingsBar' => 'Hide peer settings bar',
+ 'method_messages.hidePeerSettingsBar_param_peer_type_InputPeer' => 'Peer',
+ 'method_channels.createChannel_param_geo_point_type_InputGeoPoint' => 'Geopoint (geochats)',
+ 'method_channels.createChannel_param_address_type_string' => 'Physical address (geochats)',
+ 'method_channels.getAdminedPublicChannels_param_by_location_type_true' => 'Get channels by location',
+ 'method_channels.getAdminedPublicChannels_param_check_limit_type_true' => 'Check limit',
+ 'method_channels.editCreator' => 'Edit creator of channel',
+ 'method_channels.editCreator_param_channel_type_InputChannel' => 'Channel',
+ 'method_channels.editCreator_param_user_id_type_InputUser' => 'User ID',
+ 'method_channels.editCreator_param_password_type_InputCheckPasswordSRP' => 'Password',
+ 'method_channels.editLocation' => 'Edit location (geochats)',
+ 'method_channels.editLocation_param_channel_type_InputChannel' => 'Channel',
+ 'method_channels.editLocation_param_geo_point_type_InputGeoPoint' => 'Geo point',
+ 'method_channels.editLocation_param_address_type_string' => 'Physical location (geochats)',
+ 'object_channelFull_param_can_set_location_type_true' => 'Can set location?',
+ 'object_channelFull_param_location_type_ChannelLocation' => 'Location',
+ 'object_peerSettings_param_add_contact_type_true' => 'Can add as a contact?',
+ 'object_peerSettings_param_block_contact_type_true' => 'Block contact',
+ 'object_peerSettings_param_share_contact_type_true' => 'Share contact',
+ 'object_peerSettings_param_need_contacts_exception_type_true' => 'Contact exception',
+ 'object_peerSettings_param_report_geo_type_true' => 'Geotype',
+ 'object_inputReportReasonGeoIrrelevant' => 'Irrelevant geochat',
+ 'object_userFull_param_settings_type_PeerSettings' => 'Peer settings',
+ 'object_updatePeerSettings' => 'Peer settings updated',
+ 'object_updatePeerSettings_param_peer_type_Peer' => 'Peer',
+ 'object_updatePeerSettings_param_settings_type_PeerSettings' => 'Settings',
+ 'object_updatePeerLocated' => 'Peer location updated',
+ 'object_updatePeerLocated_param_peers_type_Vector t' => 'Peers',
+ 'object_stickerSet_param_animated_type_true' => 'Animated stickerset?',
+ 'object_messageEntityUnderline' => 'Underline',
+ 'object_messageEntityUnderline_param_offset_type_int' => 'Offset',
+ 'object_messageEntityUnderline_param_length_type_int' => 'Length',
+ 'object_messageEntityStrike' => 'Strikethrough',
+ 'object_messageEntityStrike_param_offset_type_int' => 'Offset',
+ 'object_messageEntityStrike_param_length_type_int' => 'Length',
+ 'object_messageEntityBlockquote' => 'Quote',
+ 'object_messageEntityBlockquote_param_offset_type_int' => 'Offset',
+ 'object_messageEntityBlockquote_param_length_type_int' => 'Length',
+ 'object_channelAdminLogEventActionChangeLocation' => 'Channel location changed',
+ 'object_channelAdminLogEventActionChangeLocation_param_prev_value_type_ChannelLocation' => 'Previous value',
+ 'object_channelAdminLogEventActionChangeLocation_param_new_value_type_ChannelLocation' => 'New value',
+ 'object_channelLocationEmpty' => 'No physical location (normal chat/channel)',
+ 'object_channelLocation' => 'Physical location (getchats)',
+ 'object_channelLocation_param_geo_point_type_GeoPoint' => 'Geo point',
+ 'object_channelLocation_param_address_type_string' => 'Physical address',
+ 'object_peerLocated' => 'Located peer',
+ 'object_peerLocated_param_peer_type_Peer' => 'Peer',
+ 'object_peerLocated_param_expires_type_int' => 'Expiry date',
+ 'object_peerLocated_param_distance_type_int' => 'Distance',
),
);
@@ -9991,5 +10051,65 @@ class Lang
'object_urlAuthResultAccepted' => 'URL authorization accepted',
'object_urlAuthResultAccepted_param_url_type_string' => 'URL',
'object_urlAuthResultDefault' => 'Default result',
+ 'method_contacts.addContact' => 'Add contact',
+ 'method_contacts.addContact_param_add_phone_privacy_exception_type_true' => 'Phone privacy exception?',
+ 'method_contacts.addContact_param_id_type_InputUser' => 'ID',
+ 'method_contacts.addContact_param_first_name_type_string' => 'First name',
+ 'method_contacts.addContact_param_last_name_type_string' => 'Last name',
+ 'method_contacts.addContact_param_phone_type_string' => 'Phone number',
+ 'method_contacts.acceptContact' => 'Accept contact',
+ 'method_contacts.acceptContact_param_id_type_InputUser' => 'ID',
+ 'method_contacts.getLocated' => 'Get people nearby (geochats)',
+ 'method_contacts.getLocated_param_geo_point_type_InputGeoPoint' => 'Current location',
+ 'method_messages.searchGlobal_param_folder_id_type_int' => 'Folder ID',
+ 'method_messages.hidePeerSettingsBar' => 'Hide peer settings bar',
+ 'method_messages.hidePeerSettingsBar_param_peer_type_InputPeer' => 'Peer',
+ 'method_channels.createChannel_param_geo_point_type_InputGeoPoint' => 'Geopoint (geochats)',
+ 'method_channels.createChannel_param_address_type_string' => 'Physical address (geochats)',
+ 'method_channels.getAdminedPublicChannels_param_by_location_type_true' => 'Get channels by location',
+ 'method_channels.getAdminedPublicChannels_param_check_limit_type_true' => 'Check limit',
+ 'method_channels.editCreator' => 'Edit creator of channel',
+ 'method_channels.editCreator_param_channel_type_InputChannel' => 'Channel',
+ 'method_channels.editCreator_param_user_id_type_InputUser' => 'User ID',
+ 'method_channels.editCreator_param_password_type_InputCheckPasswordSRP' => 'Password',
+ 'method_channels.editLocation' => 'Edit location (geochats)',
+ 'method_channels.editLocation_param_channel_type_InputChannel' => 'Channel',
+ 'method_channels.editLocation_param_geo_point_type_InputGeoPoint' => 'Geo point',
+ 'method_channels.editLocation_param_address_type_string' => 'Physical location (geochats)',
+ 'object_channelFull_param_can_set_location_type_true' => 'Can set location?',
+ 'object_channelFull_param_location_type_ChannelLocation' => 'Location',
+ 'object_peerSettings_param_add_contact_type_true' => 'Can add as a contact?',
+ 'object_peerSettings_param_block_contact_type_true' => 'Block contact',
+ 'object_peerSettings_param_share_contact_type_true' => 'Share contact',
+ 'object_peerSettings_param_need_contacts_exception_type_true' => 'Contact exception',
+ 'object_peerSettings_param_report_geo_type_true' => 'Geotype',
+ 'object_inputReportReasonGeoIrrelevant' => 'Irrelevant geochat',
+ 'object_userFull_param_settings_type_PeerSettings' => 'Peer settings',
+ 'object_updatePeerSettings' => 'Peer settings updated',
+ 'object_updatePeerSettings_param_peer_type_Peer' => 'Peer',
+ 'object_updatePeerSettings_param_settings_type_PeerSettings' => 'Settings',
+ 'object_updatePeerLocated' => 'Peer location updated',
+ 'object_updatePeerLocated_param_peers_type_Vector t' => 'Peers',
+ 'object_stickerSet_param_animated_type_true' => 'Animated stickerset?',
+ 'object_messageEntityUnderline' => 'Underline',
+ 'object_messageEntityUnderline_param_offset_type_int' => 'Offset',
+ 'object_messageEntityUnderline_param_length_type_int' => 'Length',
+ 'object_messageEntityStrike' => 'Strikethrough',
+ 'object_messageEntityStrike_param_offset_type_int' => 'Offset',
+ 'object_messageEntityStrike_param_length_type_int' => 'Length',
+ 'object_messageEntityBlockquote' => 'Quote',
+ 'object_messageEntityBlockquote_param_offset_type_int' => 'Offset',
+ 'object_messageEntityBlockquote_param_length_type_int' => 'Length',
+ 'object_channelAdminLogEventActionChangeLocation' => 'Channel location changed',
+ 'object_channelAdminLogEventActionChangeLocation_param_prev_value_type_ChannelLocation' => 'Previous value',
+ 'object_channelAdminLogEventActionChangeLocation_param_new_value_type_ChannelLocation' => 'New value',
+ 'object_channelLocationEmpty' => 'No physical location (normal chat/channel)',
+ 'object_channelLocation' => 'Physical location (getchats)',
+ 'object_channelLocation_param_geo_point_type_GeoPoint' => 'Geo point',
+ 'object_channelLocation_param_address_type_string' => 'Physical address',
+ 'object_peerLocated' => 'Located peer',
+ 'object_peerLocated_param_peer_type_Peer' => 'Peer',
+ 'object_peerLocated_param_expires_type_int' => 'Expiry date',
+ 'object_peerLocated_param_distance_type_int' => 'Distance',
);
}
\ No newline at end of file
diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php
index 431a1c7d..daa08eae 100644
--- a/src/danog/MadelineProto/MTProto.php
+++ b/src/danog/MadelineProto/MTProto.php
@@ -73,7 +73,7 @@ class MTProto extends AsyncConstruct implements TLCallback
/*
const V = 71;
*/
- const V = 125;
+ const V = 126;
const RELEASE = '4.0';
const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1;
@@ -731,12 +731,12 @@ class MTProto extends AsyncConstruct implements TLCallback
'lang_pack' => $lang_pack,
], 'tl_schema' => [
// TL scheme files
- 'layer' => 100,
+ 'layer' => 102,
// layer version
'src' => [
'mtproto' => __DIR__.'/TL_mtproto_v1.tl',
// mtproto TL scheme
- 'telegram' => __DIR__.'/TL_telegram_v100.tl',
+ 'telegram' => __DIR__.'/TL_telegram_v102.tl',
// telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl',
// secret chats TL scheme
diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPI.php b/src/danog/MadelineProto/TL/Conversion/BotAPI.php
index 81f3d1dd..50d73045 100644
--- a/src/danog/MadelineProto/TL/Conversion/BotAPI.php
+++ b/src/danog/MadelineProto/TL/Conversion/BotAPI.php
@@ -407,6 +407,35 @@ trait BotAPI
$new_message .= "\n";
$offset++;
break;
+ case 's':
+ case 'strike':
+ case 'del':
+ $text = $this->html_entity_decode($node->textContent);
+
+ $length = $this->mb_strlen($text);
+ $entities[] = ['_' => 'messageEntityStrike', 'offset' => $offset, 'length' => $length];
+
+ $new_message .= $text;
+ $offset += $length;
+ break;
+ case 'u':
+ $text = $this->html_entity_decode($node->textContent);
+
+ $length = $this->mb_strlen($text);
+ $entities[] = ['_' => 'messageEntityUnderline', 'offset' => $offset, 'length' => $length];
+
+ $new_message .= $text;
+ $offset += $length;
+ break;
+ case 'blockquote':
+ $text = $this->html_entity_decode($node->textContent);
+
+ $length = $this->mb_strlen($text);
+ $entities[] = ['_' => 'messageEntityBlockquote', 'offset' => $offset, 'length' => $length];
+
+ $new_message .= $text;
+ $offset += $length;
+ break;
case 'b':
case 'strong':
$text = $this->html_entity_decode($node->textContent);
@@ -659,7 +688,7 @@ trait BotAPI
public function html_fixtags($text)
{
$diff = 0;
- preg_match_all('#(.*?)(<(a|b|\bstrong\b|\bem\b|i|\bcode\b|\bpre\b)[^>]*>)(.*?)(<\s*/\s*\3>)#is', $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
+ preg_match_all('#(.*?)(<(\bu\b|\bs\b|\ba\b|\bb\b|\bstrong\b|\bblockquote\b|\bstrike\b|\bdel\b|\bem\b|i|\bcode\b|\bpre\b)[^>]*>)(.*?)([<]\s*/\s*\3[>])#is', $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
if ($matches) {
foreach ($matches as $match) {
if (trim($match[1][0]) != '') {
diff --git a/src/danog/MadelineProto/TL_telegram_v102.tl b/src/danog/MadelineProto/TL_telegram_v102.tl
new file mode 100644
index 00000000..8d69f8e5
--- /dev/null
+++ b/src/danog/MadelineProto/TL_telegram_v102.tl
@@ -0,0 +1,1365 @@
+---types---
+ipPort#d433ad73 ipv4:int port:int = IpPort;
+ipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;
+accessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector = AccessPointRule;
+help.configSimple#5a592a6c date:int expires:int rules:vector = help.ConfigSimple;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+true#3fedd339 = True;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;
+inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;
+inputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;
+inputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUser#d8292816 user_id:int access_hash:long = InputUser;
+inputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;
+inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;
+inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;
+inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia;
+inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;
+inputMediaGifExternal#4843b0fd url:string q:string = InputMedia;
+inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;
+inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
+inputMediaGame#d33f43f3 id:InputGame = InputMedia;
+inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
+inputMediaGeoLive#ce4e82fd flags:# stopped:flags.0?true geo_point:InputGeoPoint period:flags.1?int = InputMedia;
+inputMediaPoll#6b3765b poll:Poll = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto;
+inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;
+
+inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
+inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
+inputTakeoutFileLocation#29be5899 = InputFileLocation;
+inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
+inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation;
+inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+peerChannel#bddde532 channel_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+userEmpty#200250ba id:int = User;
+user#2e13f4c3 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#ecd75d8c photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
+chatForbidden#7328bdb id:int title:string = Chat;
+channel#4df30834 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
+channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;
+
+chatFull#1b7c9db3 flags:# can_set_username:flags.7?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull;
+channelFull#10916653 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_view_stats:flags.12?true can_set_location:flags.16?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation pts:int = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+chatParticipantCreator#da13538a user_id:int = ChatParticipant;
+chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;
+chatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#475cdbd5 photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#44f9b43d flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long = Message;
+messageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
+messageMediaGame#fdb19008 game:Game = MessageMedia;
+messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;
+messageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia;
+messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#488a7337 users:Vector = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
+messageActionChannelCreate#95d2ac92 title:string = MessageAction;
+messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;
+messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;
+messageActionPinMessage#94bd38ed = MessageAction;
+messageActionHistoryClear#9fbab604 = MessageAction;
+messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
+messageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;
+messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;
+messageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;
+messageActionScreenshotTaken#4792929b = MessageAction;
+messageActionCustomAction#fae69f56 message:string = MessageAction;
+messageActionBotAllowed#abe9affe domain:string = MessageAction;
+messageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;
+messageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;
+messageActionContactSignUp#f3f25f76 = MessageAction;
+
+dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
+dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#d07504a5 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector dc_id:int = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#296f104 long:double lat:double access_hash:long = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#38faab5f flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int terms_of_service:flags.3?help.TermsOfService = auth.SentCode;
+
+auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;
+
+inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings;
+
+peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;
+
+peerSettings#818426cd flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true = PeerSettings;
+
+wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
+
+inputReportReasonSpam#58dbcab8 = ReportReason;
+inputReportReasonViolence#1e22c78d = ReportReason;
+inputReportReasonPornography#2e59d922 = ReportReason;
+inputReportReasonChildAbuse#adf44ee3 = ReportReason;
+inputReportReasonOther#e1746d0a text:string = ReportReason;
+inputReportReasonCopyright#9b89f93a = ReportReason;
+inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
+
+userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;
+
+contacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector users:Vector = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector users:Vector = contacts.Blocked;
+
+messages.dialogs#15ba6c40 dialogs:Vector