Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/src/models/comment_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion lib/src/models/mixins/voteable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down