| 331 | } |
| 332 | |
| 333 | MTPInputUser UserData::inputUser() const { |
| 334 | const auto item = isLoaded() ? nullptr : owner().messageWithPeer(id); |
| 335 | if (item) { |
| 336 | const auto peer = item->history()->peer; |
| 337 | Assert(peer.get() != this); |
| 338 | |
| 339 | return MTP_inputUserFromMessage( |
| 340 | item->history()->peer->input(), |
| 341 | MTP_int(item->id.bare), |
| 342 | MTP_long(peerToUser(id).bare)); |
| 343 | } else if (isSelf()) { |
| 344 | return MTP_inputUserSelf(); |
| 345 | } |
| 346 | return MTP_inputUser( |
| 347 | MTP_long(peerToUser(id).bare), |
| 348 | MTP_long(_accessHash)); |
| 349 | } |
| 350 | |
| 351 | void UserData::setName( |
| 352 | const QString &newFirstName, |
no test coverage detected