diff --git a/lib/src/models/comment_impl.dart b/lib/src/models/comment_impl.dart index ab75cae..0246628 100644 --- a/lib/src/models/comment_impl.dart +++ b/lib/src/models/comment_impl.dart @@ -259,9 +259,6 @@ class Comment extends CommentRef /// Is this [Comment] archived. bool get archived => data!['archived']; - // TODO(bkonyi): update this definition. - // RedditorRef get author => reddit.redditor(data['author']); - /// The author's flair text, if set. /// /// Returns `null` if the author does not have any flair text set. diff --git a/lib/src/models/mixins/voteable.dart b/lib/src/models/mixins/voteable.dart index e421b02..0fe3bbd 100644 --- a/lib/src/models/mixins/voteable.dart +++ b/lib/src/models/mixins/voteable.dart @@ -7,6 +7,7 @@ import 'dart:async'; import 'package:draw/src/api_paths.dart'; import 'package:draw/src/base.dart'; +import 'package:draw/src/models/redditor.dart'; enum VoteState { none, @@ -27,9 +28,13 @@ int _voteStateToIndex(VoteState vote) { /// A mixin which provides voting functionality for [Comment] and [Submission]. mixin VoteableMixin implements RedditBaseInitializedMixin { - /// The author of the item. + + /// The name of the author associated with this item. String get author => data!['author']; + /// Returns the [Redditor] associated with this item. + RedditorRef get redditor => RedditorRef.name(reddit, data!['author']); + /// The body of the item. /// /// Returns null for non-text [Submission]s.