Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions app/src/main/java/org/thunderdog/challegram/data/PageBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.drinkless.td.libcore.telegram.TdApi;
import org.thunderdog.challegram.R;
import org.thunderdog.challegram.core.Lang;
import org.thunderdog.challegram.loader.ComplexReceiver;
import org.thunderdog.challegram.loader.DoubleImageReceiver;
import org.thunderdog.challegram.loader.ImageReceiver;
Expand Down Expand Up @@ -465,8 +466,24 @@ public static ArrayList<PageBlock> parse (ViewController<?> parent, String url,
if (detailsBlock == null) {
context.setClosed(true, parent, out, true);
boolean needReportButton = !parent.tdlib().isKnownHost(url, true);
if (instantView.viewCount > 0 || needReportButton) {
// TODO view counter + "Wrong layout?"
if (/*instantView.viewCount > 0 || */needReportButton) {
TdApi.RichTexts texts = new TdApi.RichTexts();
TdApi.InternalLinkTypeBotStart link = (TdApi.InternalLinkTypeBotStart) instantView.feedbackLink;
TdApi.RichText wrongLayout = new TdApi.RichTextUrl(new TdApi.RichTextPlain(Lang.getString(R.string.WrongLayout)), parent.tdlib().tMeUrl() + link.botUsername + "?start=" + link.startParameter, false);

/*
TdApi.RichText viewCount = new TdApi.RichTextPlain(Lang.plural(R.string.xViews, instantView.viewCount));
if (instantView.viewCount > 0 && needReportButton) {
texts.texts = new TdApi.RichText[] {
viewCount, new TdApi.RichTextPlain(Lang.getString(R.string.format_ivAuthorDateSeparator)), wrongLayout
};
} else {
texts.texts = new TdApi.RichText[] { needReportButton ? wrongLayout : viewCount };
}
*/

texts.texts = new TdApi.RichText[] { wrongLayout };
context.process(new PageBlockRichText(parent, new TdApi.PageBlockFooter(texts), false, null), out);
}
}
return out;
Expand Down