Skip to content

Commit

Permalink
⌨️ New messaging initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
benlmyers committed Sep 8, 2022
1 parent ed19160 commit 326db91
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ public class MessagingNotification: Model, Equatable {

// MARK: - Public Initalizers

public init<T>(title: String,
body: String,
from user: T,
in category: MessageCategory,
attach image: URL? = nil,
key: String? = nil
) where T: EasyUser {
self.user = user.id
self.title = title
self.body = body
self.category = category
self.image = image
self.key = key
}

public init<T>(_ message: String,
from user: T,
in category: MessageCategory,
Expand Down

0 comments on commit 326db91

Please sign in to comment.