| 38 | namespace { |
| 39 | |
| 40 | void 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 | |
| 68 | void SendSimpleMedia(SendAction action, MTPInputMedia inputMedia) { |
| 69 | const auto history = action.history; |
no test coverage detected