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(message): Parameter added to FORGET a message sent through the permission system #179

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading