Skip to content

Commit

Permalink
Fix: adding extra extension to blossom URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Nov 20, 2024
1 parent c207106 commit 82836e8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions gossip-bin/src/ui/feed/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,16 +1007,20 @@ fn offer_attachment(app: &mut GossipUi, ctx: &Context, ui: &mut Ui, dm: bool) {
if dm {
app.dm_draft_data.draft.push(' ');
app.dm_draft_data.draft.push_str(&bd.url);
if let Some(ext) = pathbuf.extension() {
app.dm_draft_data.draft.push('.');
app.dm_draft_data.draft.push_str(&ext.to_string_lossy());
if bd.url.len() > 5 && !bd.url[bd.url.len() - 5..].contains('.') {
if let Some(ext) = pathbuf.extension() {
app.dm_draft_data.draft.push('.');
app.dm_draft_data.draft.push_str(&ext.to_string_lossy());
}
}
} else {
app.draft_data.draft.push(' ');
app.draft_data.draft.push_str(&bd.url);
if let Some(ext) = pathbuf.extension() {
app.draft_data.draft.push('.');
app.draft_data.draft.push_str(&ext.to_string_lossy());
if bd.url.len() > 5 && !bd.url[bd.url.len() - 5..].contains('.') {
if let Some(ext) = pathbuf.extension() {
app.draft_data.draft.push('.');
app.draft_data.draft.push_str(&ext.to_string_lossy());
}
}
}
clear_uploading = true;
Expand Down

0 comments on commit 82836e8

Please sign in to comment.