Skip to content

Commit

Permalink
feat(message): Parameter added to FORGET a message sent through the p…
Browse files Browse the repository at this point in the history
…ermission system (#179)
  • Loading branch information
RezaRahemtola authored Aug 7, 2024
1 parent cef56a3 commit 6514c3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/message/src/forget/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class ForgetMessageClient {
*/
async send({
account,
address,
hashes,
reason,
channel,
Expand All @@ -31,10 +32,10 @@ export class ForgetMessageClient {
}: ForgetPublishConfiguration): Promise<ForgetMessage> {
const timestamp = Date.now() / 1000
const forgetContent: ForgetContent = {
address: account.address,
address: address ?? account.address,
time: timestamp,
hashes: hashes,
reason: reason || undefined,
hashes,
reason,
}

const builtMessage = buildForgetMessage({
Expand Down
1 change: 1 addition & 0 deletions packages/message/src/forget/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type ForgetContent = BaseContent & {
*/
export type ForgetPublishConfiguration = {
account: Account
address?: string
channel?: string
storageEngine?: ItemType
hashes: string[]
Expand Down
8 changes: 4 additions & 4 deletions packages/message/src/post/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export class PostMessageClient {
}: PostGetConfiguration): Promise<PostQueryResponse<T>> {
const any = (value: any) => value && value.length > 0
const params: PostQueryParams = {
types: types,
pageSize: pageSize as number,
page: page as number,
types,
pageSize,
page,
refs: any(refs) ? refs?.join(',') : undefined,
addresses: any(addresses) ? addresses?.join(',') : undefined,
tags: any(tags) ? tags?.join(',') : undefined,
Expand Down Expand Up @@ -102,7 +102,7 @@ export class PostMessageClient {
const timestamp: number = Date.now() / 1000
const postContent: PostContent<T> = {
type: postType,
address: address || account.address,
address: address ?? account.address,
content: content,
time: timestamp,
}
Expand Down

0 comments on commit 6514c3a

Please sign in to comment.