Skip to content

Commit

Permalink
Merge pull request #296 from takenet/feature/802874-sticker-support
Browse files Browse the repository at this point in the history
[Feature] #802874 - Sticker Support
  • Loading branch information
mpamaro authored Feb 4, 2025
2 parents cf66419 + cef9db9 commit 60c7a66
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/src/models/ds_media_link.model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ class DSMediaLink {

DSMediaLink.fromJson(Map<String, dynamic> json)
: uri = json['uri'],
type = json['type'],
type = _formatMimeType(
type: json['type'],
),
title = json['title'],
text = json['text'],
aspectRatio = json['aspectRatio'],
size = json['size'],
authorizationRealm = json['authorizationRealm'],
previewUri = json['previewUri'];

static String _formatMimeType({
required final String? type,
}) =>
type?.toLowerCase().replaceFirst('sticker/', 'image/') ?? '';
}

0 comments on commit 60c7a66

Please sign in to comment.