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

Method chosenRow

Telegram/SourceFiles/dialogs/dialogs_widget.cpp:881–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879}
880
881void Widget::chosenRow(const ChosenRow &row) {
882 storiesToggleExplicitExpand(false);
883
884 if (!row.sponsoredRandomId.isEmpty()) {
885 auto &messages = session().sponsoredMessages();
886 messages.clicked(row.sponsoredRandomId, false, false);
887 } else if (!_searchState.query.isEmpty()) {
888 if (const auto history = row.key.history()) {
889 session().recentPeers().bump(history->peer);
890 }
891 }
892
893 const auto history = row.key.history();
894 const auto topicJump = history
895 ? history->peer->forumTopicFor(row.topicJumpRootId)
896 : nullptr;
897 const auto sublistJump = history
898 ? history->peer->monoforumSublistFor(row.sublistJumpPeerId)
899 : nullptr;
900
901 if (topicJump) {
902 if (controller()->shownForum().current() == topicJump->forum()) {
903 controller()->closeForum();
904 } else if (row.newWindow) {
905 controller()->showInNewWindow(Window::SeparateId(topicJump));
906 } else {
907 if (!controller()->adaptive().isOneColumn()
908 && !topicJump->peer()->useSubsectionTabs()) {
909 controller()->showForum(
910 topicJump->forum(),
911 Window::SectionShow().withChildColumn());
912 }
913 controller()->showThread(
914 topicJump,
915 ShowAtUnreadMsgId,
916 Window::SectionShow::Way::ClearStack);
917 }
918 return;
919 } else if (sublistJump) {
920 if (row.newWindow) {
921 controller()->showInNewWindow(Window::SeparateId(sublistJump));
922 } else {
923 controller()->showThread(
924 sublistJump,
925 ShowAtUnreadMsgId,
926 Window::SectionShow::Way::ClearStack);
927 }
928 return;
929 } else if (const auto topic = row.key.topic()) {
930 auto params = Window::SectionShow(
931 Window::SectionShow::Way::ClearStack);
932 params.highlight = Window::SearchHighlightId(_searchState.query);
933 if (row.newWindow) {
934 controller()->showInNewWindow(
935 Window::SeparateId(topic),
936 row.message.fullId.msg);
937 } else {
938 session().data().saveViewAsMessages(topic->forum(), false);

Callers 3

WidgetMethod · 0.45
setupPostsResultsMethod · 0.45
SublistsWidgetMethod · 0.45

Calls 15

SearchHighlightIdFunction · 0.85
GetEnhancedBoolFunction · 0.85
forumTopicForMethod · 0.80
monoforumSublistForMethod · 0.80
shownForumMethod · 0.80
closeForumMethod · 0.80
showInNewWindowMethod · 0.80
withChildColumnMethod · 0.80
showThreadMethod · 0.80
saveViewAsMessagesMethod · 0.80
isSelfMethod · 0.80
openPeerStoriesMethod · 0.80

Tested by

no test coverage detected