edit_peer_reactions.h 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "data/data_peer.h"
  9. namespace Data {
  10. struct Reaction;
  11. struct AllowedReactions;
  12. } // namespace Data
  13. namespace Ui {
  14. class GenericBox;
  15. } // namespace Ui
  16. namespace Window {
  17. class SessionNavigation;
  18. } // namespace Window
  19. struct EditAllowedReactionsArgs {
  20. not_null<Window::SessionNavigation*> navigation;
  21. int allowedCustomReactions = 0;
  22. int customReactionsHardLimit = 0;
  23. bool isGroup = false;
  24. std::vector<Data::Reaction> list;
  25. Data::AllowedReactions allowed;
  26. Fn<void(int required)> askForBoosts;
  27. Fn<void(const Data::AllowedReactions &)> save;
  28. };
  29. void EditAllowedReactionsBox(
  30. not_null<Ui::GenericBox*> box,
  31. EditAllowedReactionsArgs &&args);
  32. void SaveAllowedReactions(
  33. not_null<PeerData*> peer,
  34. const Data::AllowedReactions &allowed);