Skip to content

Commit

Permalink
Merge pull request #249 from h3poteto/feat/pleroma/status
Browse files Browse the repository at this point in the history
Add Status as a Pleroma NotificationType
  • Loading branch information
h3poteto authored Sep 30, 2024
2 parents 35c95df + b795378 commit 3d07af7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pleroma/entities/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum NotificationType {
PleromaEmojiReaction,
Update,
Move,
Status,
}

impl fmt::Display for NotificationType {
Expand All @@ -59,6 +60,7 @@ impl fmt::Display for NotificationType {
NotificationType::FollowRequest => write!(f, "follow_request"),
NotificationType::Update => write!(f, "update"),
NotificationType::Move => write!(f, "move"),
NotificationType::Status => write!(f, "status"),
}
}
}
Expand All @@ -77,6 +79,7 @@ impl FromStr for NotificationType {
"follow_request" => Ok(NotificationType::FollowRequest),
"update" => Ok(NotificationType::Update),
"move" => Ok(NotificationType::Move),
"status" => Ok(NotificationType::Status),
_ => Err(Error::new_own(s.to_owned(), Kind::ParseError, None, None)),
}
}
Expand Down Expand Up @@ -124,6 +127,7 @@ impl From<NotificationType> for MegalodonEntities::notification::NotificationTyp
}
NotificationType::Update => MegalodonEntities::notification::NotificationType::Update,
NotificationType::Move => MegalodonEntities::notification::NotificationType::Move,
NotificationType::Status => MegalodonEntities::notification::NotificationType::Status,
}
}
}
Expand Down

0 comments on commit 3d07af7

Please sign in to comment.