Skip to content

Commit 158f4d2

Browse files
committed
トゥートに添付された画像のサムネイル表示に対応
1 parent 9a85acd commit 158f4d2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

OpenTween/Mastodon.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public PostClass CreatePost(MastodonStatus status)
8585
post.InReplyToUser = reblog.Mentions.LastOrDefault()?.Acct;
8686
post.IsFav = reblog.Favourited ?? false;
8787

88+
post.Media = reblog.MediaAttachments
89+
.Select(x => new MediaInfo(x.PreviewUrl)).ToList();
90+
8891
post.UserId = reblog.Account.Id;
8992
post.ScreenName = reblog.Account.Acct;
9093
post.Nickname = reblog.Account.DisplayName;
@@ -105,6 +108,9 @@ public PostClass CreatePost(MastodonStatus status)
105108
post.InReplyToUser = status.Mentions.LastOrDefault()?.Acct;
106109
post.IsFav = status.Favourited ?? false;
107110

111+
post.Media = status.MediaAttachments
112+
.Select(x => new MediaInfo(x.PreviewUrl)).ToList();
113+
108114
post.UserId = status.Account.Id;
109115
post.ScreenName = status.Account.Acct;
110116
post.Nickname = status.Account.DisplayName;

OpenTween/Thumbnail/ThumbnailGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static void InitializeGenerator()
6868
new Vimeo(),
6969

7070
// DirectLink
71-
new SimpleThumbnailService(@"^https?://.*(\.jpg|\.jpeg|\.gif|\.png|\.bmp)$", "${0}"),
71+
new SimpleThumbnailService(@"^https?://.*(\.jpg|\.jpeg|\.gif|\.png|\.bmp)(\?[^#]+)?(#.+)?$", "${0}"),
7272

7373
// img.azyobuzi.net
7474
ImgAzyobuziNetInstance,

0 commit comments

Comments
 (0)