Skip to content

Commit

Permalink
πŸ”€ Merge pull request #19 from Fedodo/dev
Browse files Browse the repository at this point in the history
🚧 Removed extent
  • Loading branch information
LNA-DEV authored Aug 1, 2023
2 parents 6953f7d + 5f803af commit c881cf0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
29 changes: 13 additions & 16 deletions lib/Models/post.dart
Original file line number Diff line number Diff line change
@@ -1,55 +1,52 @@
import 'dart:core';
import 'package:activitypub/Models/ObjectTypes/document.dart';
import 'CoreTypes/object.dart';

import 'collection.dart';

class Post extends ActivityPubObject {
class Post {
final List<String> to;
final String? name;
final String? summary;
final bool? sensitive;
final String? inReplyTo;
final String content;
final String id;
final String type;
final DateTime published;
final String attributedTo;
final Collection? replies;
final List<Document>? attachment;

Post(
this.to,
this.name,
this.summary,
this.sensitive,
this.inReplyTo,
content,
this.content,
this.id,
this.type,
this.published,
attributedTo,
this.attributedTo,
this.replies,
attachment,
) : super(
attachment,
content,
attributedTo,
);
this.attachment,
);

Post.fromJson(Map<String, dynamic> json)
: to = convertToStringList(json["to"]),
name = json["name"],
summary = json["summary"],
sensitive = json["sensitive"],
inReplyTo = json["inReplyTo"],
content = json["content"],
id = json["id"],
type = json["type"],
published = DateTime.parse(json["published"]),
attributedTo = json["attributedTo"],
attachment = toListOfDocuments(json["attachment"]),
replies = json["replies"] == null
? null
: Collection.fromJson(json["replies"]),
super(
json["attachment"],
json["content"],
json["attributedTo"],
);
: Collection.fromJson(json["replies"]);

static List<String> convertToStringList(json) {
List<String> jsonList = [];
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: activitypub
description: A library for the ActivityPub standard. Created an also used by Fedodo.
version: 1.2.8
version: 1.2.9
repository: https://github.com/Fedodo/Fedodo.Pub.ActivityPub

environment:
Expand Down

0 comments on commit c881cf0

Please sign in to comment.