mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02:00
some fixes
This commit is contained in:
parent
d5a8612ece
commit
c3f2c78678
3 changed files with 9 additions and 1 deletions
|
@ -76,7 +76,12 @@ public class Nitter implements Serializable {
|
|||
|
||||
public static Status convert(Context context, String instance, FeedItem feedItem) {
|
||||
Status status = new Status();
|
||||
status.id = feedItem.pubDate;
|
||||
Matcher matcherLink = Helper.nitterIDPattern.matcher(feedItem.link);
|
||||
if (matcherLink.find()) {
|
||||
status.id = matcherLink.group(1);
|
||||
} else {
|
||||
status.id = feedItem.pubDate;
|
||||
}
|
||||
status.content = feedItem.description;
|
||||
status.text = feedItem.title;
|
||||
status.content = status.content.replaceAll("<img [^>]*src=\"[^\"]+\"[^>]*>", "");
|
||||
|
|
|
@ -284,6 +284,8 @@ public class Helper {
|
|||
public static final Pattern mediumPattern = Pattern.compile("([\\w@-]*)?\\.?medium.com/@?([/\\w-]+)");
|
||||
public static final Pattern wikipediaPattern = Pattern.compile("([\\w_-]+)\\.wikipedia.org/(((?!([\"'<])).)*)");
|
||||
public static final Pattern codePattern = Pattern.compile("code=([\\w-]+)");
|
||||
public static final Pattern nitterIDPattern = Pattern.compile("/status/(\\d+)");
|
||||
|
||||
public static final Pattern urlPattern = Pattern.compile(
|
||||
"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,10}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))",
|
||||
|
||||
|
|
|
@ -599,6 +599,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
statuses.pagination = new Pagination();
|
||||
statuses.pagination.max_id = quickLoad.statuses.get(quickLoad.statuses.size() - 1).id;
|
||||
statuses.pagination.min_id = quickLoad.statuses.get(0).id;
|
||||
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> initializeStatusesCommonView(statuses, quickLoad.position);
|
||||
mainHandler.post(myRunnable);
|
||||
|
|
Loading…
Reference in a new issue