mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Allow sending just webpage preview.
This commit is contained in:
@@ -73,10 +73,12 @@ MTPInputReplyTo ReplyToForMTP(
|
||||
return MTPInputReplyTo();
|
||||
}
|
||||
|
||||
MTPInputMedia WebPageForMTP(const Data::WebPageDraft &draft) {
|
||||
MTPInputMedia WebPageForMTP(
|
||||
const Data::WebPageDraft &draft,
|
||||
bool required) {
|
||||
using Flag = MTPDinputMediaWebPage::Flag;
|
||||
return MTP_inputMediaWebPage(
|
||||
MTP_flags(Flag::f_optional
|
||||
MTP_flags((required ? Flag() : Flag::f_optional)
|
||||
| (draft.forceLargeMedia ? Flag::f_force_large_media : Flag())
|
||||
| (draft.forceSmallMedia ? Flag::f_force_small_media : Flag())),
|
||||
MTP_string(draft.url));
|
||||
|
@@ -30,7 +30,9 @@ struct WebPageDraft;
|
||||
[[nodiscard]] MTPInputReplyTo ReplyToForMTP(
|
||||
not_null<History*> history,
|
||||
FullReplyTo replyTo);
|
||||
[[nodiscard]] MTPInputMedia WebPageForMTP(const Data::WebPageDraft &draft);
|
||||
[[nodiscard]] MTPInputMedia WebPageForMTP(
|
||||
const Data::WebPageDraft &draft,
|
||||
bool required = false);
|
||||
|
||||
class Histories final {
|
||||
public:
|
||||
|
Reference in New Issue
Block a user