status-lib/status/profile.nim

28 lines
971 B
Nim
Raw Normal View History

2021-09-08 18:05:39 +00:00
import json
import ./types/[identity_image]
import statusgo_backend/core as statusgo_backend_core
import statusgo_backend/accounts as status_accounts
import statusgo_backend/settings as status_settings
2021-09-08 18:05:39 +00:00
import ../eventemitter
type
ProfileModel* = ref object
proc newProfileModel*(): ProfileModel =
result = ProfileModel()
proc logout*(self: ProfileModel) =
discard status_accounts.logout()
proc getLinkPreviewWhitelist*(self: ProfileModel): JsonNode =
result = status_settings.getLinkPreviewWhitelist()
proc storeIdentityImage*(self: ProfileModel, keyUID: string, imagePath: string, aX, aY, bX, bY: int): IdentityImage =
result = status_accounts.storeIdentityImage(keyUID, imagePath, aX, aY, bX, bY)
proc getIdentityImage*(self: ProfileModel, keyUID: string): IdentityImage =
result = status_accounts.getIdentityImage(keyUID)
proc deleteIdentityImage*(self: ProfileModel, keyUID: string): string =
result = status_accounts.deleteIdentityImage(keyUID)