Skip to content

Commit

Permalink
Add Pleroma NotificationType
Browse files Browse the repository at this point in the history
  • Loading branch information
WakuwakuP committed Sep 29, 2024
1 parent fc36655 commit f6cb5d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions megalodon/src/pleroma/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ namespace PleromaAPI {
return NotificationType.Update
case PleromaNotificationType.Move:
return NotificationType.Move
case PleromaNotificationType.Status:
return NotificationType.Status
default:
return new UnknownNotificationTypeError()
}
Expand All @@ -100,6 +102,8 @@ namespace PleromaAPI {
return PleromaNotificationType.Update
case NotificationType.Move:
return PleromaNotificationType.Move
case NotificationType.Status:
return PleromaNotificationType.Status
default:
return new UnknownNotificationTypeError()
}
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/pleroma/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace PleromaNotificationType {
export const FollowRequest: PleromaEntity.NotificationType = 'follow_request'
export const Update: PleromaEntity.NotificationType = 'update'
export const Move: PleromaEntity.NotificationType = 'move'
export const Status: PleromaEntity.NotificationType = 'status'
}

export default PleromaNotificationType
8 changes: 8 additions & 0 deletions megalodon/test/unit/pleroma/api_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ describe('api_client', () => {
{
src: MegalodonNotificationType.Move,
dist: PleromaNotificationType.Move
},
{
src: MegalodonNotificationType.Status,
dist: PleromaNotificationType.Status
}
]
cases.forEach(c => {
Expand Down Expand Up @@ -121,6 +125,10 @@ describe('api_client', () => {
{
src: PleromaNotificationType.Move,
dist: MegalodonNotificationType.Move
},
{
src: PleromaNotificationType.Status,
dist: MegalodonNotificationType.Status
}
]
cases.forEach(c => {
Expand Down

0 comments on commit f6cb5d5

Please sign in to comment.