MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / InnerFillMessagePostFlags

Function InnerFillMessagePostFlags

Telegram/SourceFiles/api/api_sending.cpp:40–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace {
39
40void InnerFillMessagePostFlags(
41 const SendOptions &options,
42 not_null<PeerData*> peer,
43 MessageFlags &flags) {
44 if (ShouldSendSilent(peer, options)) {
45 flags |= MessageFlag::Silent;
46 }
47 if (!peer->amAnonymous()
48 || (!peer->isBroadcast()
49 && options.sendAs
50 && options.sendAs != peer)) {
51 flags |= MessageFlag::HasFromId;
52 }
53 const auto channel = peer->asBroadcast();
54 if (!channel) {
55 return;
56 }
57 flags |= MessageFlag::Post;
58 // Don't display views and author of a new post when it's scheduled.
59 if (options.scheduled) {
60 return;
61 }
62 flags |= MessageFlag::HasViews;
63 if (channel->addsSignature()) {
64 flags |= MessageFlag::HasPostAuthor;
65 }
66}
67
68void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) {
69 const auto history = action.history;

Callers 4

SendSimpleMediaFunction · 0.85
SendExistingMediaFunction · 0.85
SendDiceFunction · 0.85
FillMessagePostFlagsFunction · 0.85

Calls 5

ShouldSendSilentFunction · 0.85
amAnonymousMethod · 0.80
asBroadcastMethod · 0.80
addsSignatureMethod · 0.80
isBroadcastMethod · 0.45

Tested by

no test coverage detected