Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add shouldPush to contentTypes messages #235

Closed
wants to merge 7 commits into from
Prev Previous commit
Next Next commit
feat: add shouldPush property to DecodedMessage class
  • Loading branch information
kele-leanes committed Feb 2, 2024
commit 36c872d1343fb46e645a8b44f597830b50cf76d0
12 changes: 9 additions & 3 deletions src/lib/DecodedMessage.ts
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ export class DecodedMessage<ContentTypes = any> {
sent: number // timestamp in milliseconds
nativeContent: NativeMessageContent
fallback: string | undefined
shouldPush: boolean

static from<ContentTypes>(
json: string,
@@ -32,7 +33,8 @@ export class DecodedMessage<ContentTypes = any> {
decoded.senderAddress,
decoded.sent,
decoded.content,
decoded.fallback
decoded.fallback,
decoded.shouldPush
)
}

@@ -45,6 +47,7 @@ export class DecodedMessage<ContentTypes = any> {
sent: number // timestamp in milliseconds
content: any
fallback: string | undefined
shouldPush: boolean
},
client: Client<ContentTypes>
): DecodedMessage<ContentTypes> {
@@ -56,7 +59,8 @@ export class DecodedMessage<ContentTypes = any> {
object.senderAddress,
object.sent,
object.content,
object.fallback
object.fallback,
object.shouldPush
)
}

@@ -68,7 +72,8 @@ export class DecodedMessage<ContentTypes = any> {
senderAddress: string,
sent: number,
content: any,
fallback: string | undefined
fallback: string | undefined,
shouldPush: boolean
) {
this.client = client
this.id = id
@@ -78,6 +83,7 @@ export class DecodedMessage<ContentTypes = any> {
this.sent = sent
this.nativeContent = content
this.fallback = fallback
this.shouldPush = shouldPush
}

content(): ContentTypes {