Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed author field to RedditorRef #213

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 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 @@ -28,7 +29,10 @@ int _voteStateToIndex(VoteState vote) {
/// A mixin which provides voting functionality for [Comment] and [Submission].
mixin VoteableMixin implements RedditBaseInitializedMixin {
/// The author of the item.
String get author => data!['author'];
// String get author => data!['author'];

/// Returns the [Redditor] associated with this item.
RedditorRef get author => RedditorRef.name(reddit, data!['author']);
SupremeDeity marked this conversation as resolved.
Show resolved Hide resolved

/// The body of the item.
///
Expand Down