Skip to content

Commit

Permalink
add get single notification feature to mastodon.
Browse files Browse the repository at this point in the history
  • Loading branch information
uakihir0 committed May 17, 2020
1 parent 339ed8f commit 64c9628
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/net/socialhub/service/mastodon/MastodonAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,24 @@ public Pageable<Notification> getNotification(Paging paging) {
});
}

/**
* Get Notification (Single)
* 通知情報を取得
*/
public Notification getNotification(Identify identify) {
return proceed(() -> {
Mastodon mastodon = auth.getAccessor();
Service service = getAccount().getService();

Response<mastodon4j.entity.Notification> notification =
mastodon.notifications()
.getNotification((Long) identify.getId());

return MastodonMapper.notification(
notification.get(), service);
});
}

// ============================================================== //
// Request
// ============================================================== //
Expand Down

0 comments on commit 64c9628

Please sign in to comment.