2023-04-28 13:28:19 +03:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQml 2.15
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2023-03-07 17:51:06 +01:00
|
|
|
import SortFilterProxyModel 0.2
|
2024-05-22 11:13:39 +03:00
|
|
|
|
|
|
|
import StatusQ 0.1
|
2022-03-22 09:29:58 +01:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2024-10-15 21:26:12 +02:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2024-05-22 11:13:39 +03:00
|
|
|
import AppLayouts.Profile.stores 1.0
|
2024-06-19 16:16:56 +02:00
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStore
|
2024-05-22 11:13:39 +03:00
|
|
|
import shared.stores 1.0
|
2024-06-19 16:16:56 +02:00
|
|
|
|
2024-05-22 11:13:39 +03:00
|
|
|
import utils 1.0
|
2024-06-19 16:16:56 +02:00
|
|
|
|
2021-10-01 18:58:36 +03:00
|
|
|
QtObject {
|
|
|
|
id: root
|
2022-01-04 13:06:05 +01:00
|
|
|
|
2024-05-22 11:13:39 +03:00
|
|
|
property ContactsStore contactsStore
|
|
|
|
property CommunityTokensStore communityTokensStore
|
|
|
|
property WalletStore.RootStore walletStore
|
2024-10-04 12:04:59 +02:00
|
|
|
property CurrenciesStore currencyStore
|
2024-05-22 11:13:39 +03:00
|
|
|
property NetworkConnectionStore networkConnectionStore
|
2023-04-04 13:31:04 +02:00
|
|
|
|
2023-03-07 09:47:04 +01:00
|
|
|
readonly property PermissionsStore permissionsStore: PermissionsStore {
|
|
|
|
activeSectionId: mainModuleInst.activeSection.id
|
2023-06-08 13:01:01 +02:00
|
|
|
activeChannelId: root.currentChatContentModule().chatDetails.id
|
2023-03-07 09:47:04 +01:00
|
|
|
chatCommunitySectionModuleInst: chatCommunitySectionModule
|
|
|
|
}
|
|
|
|
|
2022-02-15 23:00:05 +02:00
|
|
|
property bool openCreateChat: false
|
2022-03-22 09:29:58 +01:00
|
|
|
|
2022-01-04 13:06:05 +01:00
|
|
|
// Important:
|
|
|
|
// Each `ChatLayout` has its own chatCommunitySectionModule
|
|
|
|
// (on the backend chat and community sections share the same module since they are actually the same)
|
|
|
|
property var chatCommunitySectionModule
|
2024-10-15 11:31:46 +02:00
|
|
|
readonly property var sectionDetails: d.sectionDetailsInstantiator.count ? d.sectionDetailsInstantiator.objectAt(0) : null
|
2023-03-07 17:51:06 +01:00
|
|
|
|
|
|
|
property var communityItemsModel: chatCommunitySectionModule.model
|
2023-04-18 11:11:47 +02:00
|
|
|
|
2023-03-07 17:51:06 +01:00
|
|
|
property var assetsModel: SortFilterProxyModel {
|
2023-06-21 10:20:39 -04:00
|
|
|
sourceModel: communitiesModuleInst.tokenList
|
2023-03-07 17:51:06 +01:00
|
|
|
|
2024-10-15 21:26:12 +02:00
|
|
|
proxyRoles: FastExpressionRole {
|
2023-03-20 13:29:05 +01:00
|
|
|
function tokenIcon(symbol) {
|
|
|
|
return Constants.tokenIcon(symbol)
|
2023-03-07 17:51:06 +01:00
|
|
|
}
|
|
|
|
name: "iconSource"
|
2023-03-20 13:29:05 +01:00
|
|
|
expression: !!model.icon ? model.icon : tokenIcon(model.symbol)
|
2024-10-15 21:26:12 +02:00
|
|
|
expectedRoles: ["icon", "symbol"]
|
2023-03-07 17:51:06 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property var communityCollectiblesModelWithCollectionRoles: SortFilterProxyModel {
|
2023-06-21 10:20:39 -04:00
|
|
|
sourceModel: communitiesModuleInst.collectiblesModel
|
2023-03-07 17:51:06 +01:00
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
proxyRoles: [
|
2024-10-15 21:26:12 +02:00
|
|
|
FastExpressionRole {
|
2024-06-24 16:51:18 +02:00
|
|
|
function collectibleIcon(icon) {
|
2024-10-15 21:26:12 +02:00
|
|
|
return !!icon ? icon : Theme.png("tokens/DEFAULT-TOKEN")
|
2024-06-24 16:51:18 +02:00
|
|
|
}
|
2024-10-15 21:26:12 +02:00
|
|
|
name: "iconSource"
|
|
|
|
expression: collectibleIcon(model.icon)
|
|
|
|
expectedRoles: ["icon"]
|
2024-06-24 16:51:18 +02:00
|
|
|
},
|
2024-10-15 21:26:12 +02:00
|
|
|
FastExpressionRole {
|
|
|
|
name: "collectionUid"
|
|
|
|
expression: model.key
|
|
|
|
expectedRoles: ["key"]
|
2024-06-24 16:51:18 +02:00
|
|
|
},
|
2024-10-15 21:26:12 +02:00
|
|
|
FastExpressionRole {
|
2024-06-24 16:51:18 +02:00
|
|
|
function collectibleIcon(icon) {
|
2024-10-15 21:26:12 +02:00
|
|
|
return !!icon ? icon : Theme.png("tokens/DEFAULT-TOKEN")
|
2024-06-24 16:51:18 +02:00
|
|
|
}
|
2024-10-15 21:26:12 +02:00
|
|
|
name: "collectionImageUrl"
|
|
|
|
expression: collectibleIcon(model.icon)
|
|
|
|
expectedRoles: ["icon"]
|
2024-06-24 16:51:18 +02:00
|
|
|
}
|
|
|
|
]
|
2023-03-09 17:54:44 +01:00
|
|
|
}
|
2023-04-28 13:28:19 +03:00
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property var walletCollectiblesModel: ObjectProxyModel {
|
2024-06-19 16:16:56 +02:00
|
|
|
|
|
|
|
sourceModel: WalletStore.RootStore.collectiblesStore.allCollectiblesModel
|
|
|
|
|
|
|
|
delegate: QtObject {
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property string key: model.symbol ?? ""
|
2024-06-19 16:16:56 +02:00
|
|
|
readonly property string shortName: model.collectionName ? model.collectionName : model.collectionUid ? model.collectionUid : ""
|
|
|
|
readonly property string symbol: shortName
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property string name: shortName
|
|
|
|
readonly property int category: 1 // Own
|
2024-06-19 16:16:56 +02:00
|
|
|
}
|
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
exposedRoles: ["key", "symbol", "shortName", "name", "category"]
|
2024-06-19 16:16:56 +02:00
|
|
|
expectedRoles: ["symbol", "collectionName", "collectionUid"]
|
|
|
|
}
|
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property var walletCollectiblesGroupingModel: GroupingModel {
|
|
|
|
sourceModel: walletCollectiblesModel
|
|
|
|
|
|
|
|
groupingRoleName: "collectionUid"
|
|
|
|
submodelRoleName: "subnames"
|
|
|
|
}
|
2024-06-19 16:16:56 +02:00
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
readonly property var walletNonCommunityCollectiblesModel: SortFilterProxyModel {
|
|
|
|
sourceModel: walletCollectiblesGroupingModel
|
2024-06-19 16:16:56 +02:00
|
|
|
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "communityId"
|
|
|
|
value: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-24 16:51:18 +02:00
|
|
|
property var walletCollectiblesWithIconSourceModel: RolesRenamingModel {
|
|
|
|
sourceModel: walletNonCommunityCollectiblesModel
|
2024-06-19 16:16:56 +02:00
|
|
|
|
|
|
|
mapping: RoleRename {
|
|
|
|
from: "mediaUrl"
|
|
|
|
to: "iconSource"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property var collectiblesModel: ConcatModel {
|
|
|
|
sources: [
|
|
|
|
SourceModel {
|
2024-06-24 16:51:18 +02:00
|
|
|
model: communityCollectiblesModelWithCollectionRoles
|
2024-06-19 16:16:56 +02:00
|
|
|
},
|
|
|
|
SourceModel {
|
2024-06-24 16:51:18 +02:00
|
|
|
model: walletCollectiblesWithIconSourceModel
|
2024-06-19 16:16:56 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-08-22 00:54:57 +06:00
|
|
|
function prepareTokenModelForCommunity(publicKey) {
|
|
|
|
root.communitiesModuleInst.prepareTokenModelForCommunity(publicKey)
|
|
|
|
}
|
|
|
|
|
2024-09-27 13:28:27 -04:00
|
|
|
function prepareTokenModelForCommunityChat(publicKey, chatId) {
|
|
|
|
root.communitiesModuleInst.prepareTokenModelForCommunityChat(publicKey, chatId)
|
|
|
|
}
|
|
|
|
|
2024-03-25 23:46:58 +01:00
|
|
|
readonly property bool allChannelsAreHiddenBecauseNotPermitted: root.chatCommunitySectionModule.allChannelsAreHiddenBecauseNotPermitted &&
|
|
|
|
!root.chatCommunitySectionModule.requiresTokenPermissionToJoin
|
2024-03-18 18:33:07 +01:00
|
|
|
|
2024-05-07 14:46:54 -04:00
|
|
|
readonly property int communityMemberReevaluationStatus: root.chatCommunitySectionModule && root.chatCommunitySectionModule.communityMemberReevaluationStatus
|
|
|
|
|
2023-08-22 14:04:58 -04:00
|
|
|
readonly property bool requirementsCheckPending: root.communitiesModuleInst.requirementsCheckPending
|
|
|
|
|
2023-08-22 00:54:57 +06:00
|
|
|
readonly property var permissionsModel: !!root.communitiesModuleInst.spectatedCommunityPermissionModel ?
|
|
|
|
root.communitiesModuleInst.spectatedCommunityPermissionModel : null
|
|
|
|
|
2023-08-02 20:03:52 +04:00
|
|
|
readonly property string overviewChartData: chatCommunitySectionModule.overviewChartData
|
|
|
|
|
2024-10-15 11:31:46 +02:00
|
|
|
readonly property bool isUserAllowedToSendMessage: d.isUserAllowedToSendMessage
|
|
|
|
readonly property string chatInputPlaceHolderText: d.chatInputPlaceHolderText
|
|
|
|
readonly property var oneToOneChatContact: d.oneToOneChatContact
|
2022-01-04 13:06:05 +01:00
|
|
|
// Since qml component doesn't follow encaptulation from the backend side, we're introducing
|
|
|
|
// a method which will return appropriate chat content module for selected chat/channel
|
2024-03-20 13:58:46 -04:00
|
|
|
function currentChatContentModule() {
|
2022-01-04 13:06:05 +01:00
|
|
|
// When we decide to have the same struct as it's on the backend we will remove this function.
|
2023-01-27 10:24:00 -05:00
|
|
|
// So far this is a way to deal with refactored backend from the current qml structure.
|
|
|
|
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatCommunitySectionModule.activeItem.id)
|
2022-01-04 13:06:05 +01:00
|
|
|
return chatCommunitySectionModule.getChatContentModule()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Contact requests related part
|
|
|
|
property var contactRequestsModel: chatCommunitySectionModule.contactRequestsModel
|
|
|
|
|
2023-02-07 15:21:32 +01:00
|
|
|
property bool loadingHistoryMessagesInProgress: chatCommunitySectionModule.loadingHistoryMessagesInProgress
|
2022-02-07 17:55:14 -04:00
|
|
|
|
2022-04-08 12:41:35 +02:00
|
|
|
property var advancedModule: profileSectionModule.advancedModule
|
|
|
|
|
2023-10-16 17:05:55 +01:00
|
|
|
property var privacyModule: profileSectionModule.privacyModule
|
|
|
|
|
2023-08-04 15:14:06 +02:00
|
|
|
readonly property bool permissionsCheckOngoing: chatCommunitySectionModule.permissionsCheckOngoing
|
|
|
|
|
2024-07-19 14:45:40 -04:00
|
|
|
readonly property bool ensCommunityPermissionsEnabled: localAccountSensitiveSettings.ensCommunityPermissionsEnabled
|
|
|
|
|
2022-11-28 15:57:56 +01:00
|
|
|
signal importingCommunityStateChanged(string communityId, int state, string errorMsg)
|
|
|
|
|
2023-07-21 11:44:10 +03:00
|
|
|
signal communityAdded(string communityId)
|
|
|
|
|
2023-06-08 13:01:01 +02:00
|
|
|
signal communityAccessRequested(string communityId)
|
|
|
|
|
2023-04-06 14:11:57 +03:00
|
|
|
signal goToMembershipRequestsPage()
|
|
|
|
|
2022-01-25 15:07:03 -05:00
|
|
|
function setActiveCommunity(communityId) {
|
|
|
|
mainModule.setActiveSectionById(communityId);
|
|
|
|
}
|
|
|
|
|
2022-10-20 11:05:10 +02:00
|
|
|
function activateStatusDeepLink(link) {
|
|
|
|
mainModuleInst.activateStatusDeepLink(link)
|
|
|
|
}
|
|
|
|
|
2022-01-25 15:07:03 -05:00
|
|
|
function setObservedCommunity(communityId) {
|
|
|
|
communitiesModuleInst.setObservedCommunity(communityId);
|
|
|
|
}
|
|
|
|
|
2022-02-09 18:35:59 +01:00
|
|
|
function getMySectionId() {
|
|
|
|
return chatCommunitySectionModule.getMySectionId()
|
|
|
|
}
|
|
|
|
|
2022-11-08 09:36:08 +01:00
|
|
|
function amIChatAdmin() {
|
|
|
|
return currentChatContentModule().amIChatAdmin()
|
|
|
|
}
|
|
|
|
|
2023-04-03 20:27:56 +04:00
|
|
|
function acceptContactRequest(pubKey, contactRequestId) {
|
|
|
|
chatCommunitySectionModule.acceptContactRequest(pubKey, contactRequestId)
|
2022-01-04 13:06:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function acceptAllContactRequests() {
|
|
|
|
chatCommunitySectionModule.acceptAllContactRequests()
|
|
|
|
}
|
|
|
|
|
2023-04-03 20:27:56 +04:00
|
|
|
function dismissContactRequest(pubKey, contactRequestId) {
|
|
|
|
chatCommunitySectionModule.dismissContactRequest(pubKey, contactRequestId)
|
2022-01-04 13:06:05 +01:00
|
|
|
}
|
|
|
|
|
2022-05-27 11:57:18 +03:00
|
|
|
function dismissAllContactRequests() {
|
|
|
|
chatCommunitySectionModule.dismissAllContactRequests()
|
2022-01-04 13:06:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function blockContact(pubKey) {
|
|
|
|
chatCommunitySectionModule.blockContact(pubKey)
|
|
|
|
}
|
|
|
|
|
2022-03-22 09:29:58 +01:00
|
|
|
function interpretMessage(msg) {
|
|
|
|
if (msg.startsWith("/shrug")) {
|
|
|
|
return msg.replace("/shrug", "") + " ¯\\\\\\_(ツ)\\_/¯"
|
|
|
|
}
|
|
|
|
if (msg.startsWith("/tableflip")) {
|
|
|
|
return msg.replace("/tableflip", "") + " (╯°□°)╯︵ ┻━┻"
|
|
|
|
}
|
|
|
|
|
|
|
|
return msg
|
|
|
|
}
|
|
|
|
|
2023-07-11 14:30:55 +03:00
|
|
|
function cleanMessageText(formattedMessage) {
|
2024-10-08 13:20:50 +02:00
|
|
|
const text = StatusQUtils.StringUtils.plainText(StatusQUtils.Emoji.deparse(formattedMessage))
|
2023-07-11 14:30:55 +03:00
|
|
|
return interpretMessage(text)
|
|
|
|
}
|
|
|
|
|
2023-01-09 23:13:08 +02:00
|
|
|
function sendMessage(chatId, event, text, replyMessageId, fileUrlsAndSources) {
|
|
|
|
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
|
|
|
|
const chatContentModule = chatCommunitySectionModule.getChatContentModule()
|
2023-01-10 16:50:47 +02:00
|
|
|
var result = false
|
|
|
|
|
2023-07-11 14:30:55 +03:00
|
|
|
const textMsg = cleanMessageText(text)
|
2023-03-06 15:47:35 +06:00
|
|
|
if (textMsg.trim() !== "") {
|
2023-07-11 14:30:55 +03:00
|
|
|
if (event)
|
2022-03-22 09:29:58 +01:00
|
|
|
event.accepted = true
|
2023-03-06 15:47:35 +06:00
|
|
|
}
|
2022-03-22 09:29:58 +01:00
|
|
|
|
2023-03-06 15:47:35 +06:00
|
|
|
if (fileUrlsAndSources.length > 0) {
|
2023-03-30 00:26:56 +02:00
|
|
|
chatContentModule.inputAreaModule.sendImages(JSON.stringify(fileUrlsAndSources), textMsg.trim(), replyMessageId)
|
2023-01-10 16:50:47 +02:00
|
|
|
result = true
|
2023-03-06 15:47:35 +06:00
|
|
|
|
|
|
|
} else {
|
|
|
|
if (textMsg.trim() !== "") {
|
|
|
|
chatContentModule.inputAreaModule.sendMessage(
|
|
|
|
textMsg,
|
|
|
|
replyMessageId,
|
|
|
|
Utils.isOnlyEmoji(textMsg) ? Constants.messageContentType.emojiType : Constants.messageContentType.messageType,
|
|
|
|
false)
|
|
|
|
|
|
|
|
result = true
|
|
|
|
}
|
2022-03-22 09:29:58 +01:00
|
|
|
}
|
2023-03-06 15:47:35 +06:00
|
|
|
|
2023-01-10 16:50:47 +02:00
|
|
|
return result
|
2022-03-22 09:29:58 +01:00
|
|
|
}
|
|
|
|
|
2023-01-26 19:52:41 +01:00
|
|
|
function openCloseCreateChatView() {
|
|
|
|
if (root.openCreateChat) {
|
|
|
|
Global.closeCreateChatView()
|
|
|
|
} else {
|
|
|
|
Global.openCreateChatView()
|
|
|
|
}
|
|
|
|
}
|
2022-01-04 13:06:05 +01:00
|
|
|
|
2024-05-22 11:13:39 +03:00
|
|
|
property MessageStore messageStore: MessageStore { }
|
2022-01-13 23:41:43 +02:00
|
|
|
|
2022-01-05 16:50:03 +01:00
|
|
|
property var emojiReactionsModel
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2022-01-13 11:16:11 +01:00
|
|
|
property var globalUtilsInst: globalUtils
|
|
|
|
|
2022-01-05 10:11:26 -05:00
|
|
|
property var mainModuleInst: mainModule
|
2022-09-15 19:34:41 +03:00
|
|
|
|
2024-10-04 09:46:53 +02:00
|
|
|
readonly property string appNetworkId: mainModuleInst.appNetworkId
|
|
|
|
|
2021-12-14 14:21:50 -05:00
|
|
|
property var communitiesModuleInst: communitiesModule
|
|
|
|
property var communitiesList: communitiesModuleInst.model
|
|
|
|
|
2022-02-09 01:04:49 +01:00
|
|
|
property string signingPhrase: walletSection.signingPhrase
|
|
|
|
|
2022-05-16 18:02:03 +03:00
|
|
|
property string channelEmoji: chatCommunitySectionModule && chatCommunitySectionModule.emoji ? chatCommunitySectionModule.emoji : ""
|
2022-03-14 15:32:52 -04:00
|
|
|
|
2021-11-30 11:50:53 +01:00
|
|
|
property ListModel addToGroupContacts: ListModel {}
|
|
|
|
|
2023-04-20 10:41:45 +02:00
|
|
|
property var walletSectionSendInst: walletSectionSend
|
2022-02-09 01:04:49 +01:00
|
|
|
|
2022-06-09 17:59:54 +03:00
|
|
|
property string communityTags: communitiesModule.tags
|
|
|
|
|
2021-11-25 12:12:19 -05:00
|
|
|
property var stickersModuleInst: stickersModule
|
2021-11-15 10:15:21 -05:00
|
|
|
|
2023-01-06 15:19:27 -05:00
|
|
|
property bool isDebugEnabled: advancedModule ? advancedModule.isDebugEnabled : false
|
|
|
|
|
2023-03-30 12:42:28 +03:00
|
|
|
readonly property int loginType: getLoginType()
|
|
|
|
|
2024-10-15 11:31:46 +02:00
|
|
|
property string name: d.userProfileInst.name
|
2024-10-02 09:54:35 -04:00
|
|
|
|
2024-05-22 11:13:39 +03:00
|
|
|
property StickersStore stickersStore: StickersStore {
|
2022-02-14 19:27:23 -04:00
|
|
|
stickersModule: stickersModuleInst
|
|
|
|
}
|
|
|
|
|
2022-08-10 15:18:20 -04:00
|
|
|
function sendSticker(channelId, hash, replyTo, pack, url) {
|
|
|
|
stickersModuleInst.send(channelId, hash, replyTo, pack, url)
|
2021-12-22 09:55:13 -05:00
|
|
|
}
|
|
|
|
|
2022-03-09 11:27:32 +01:00
|
|
|
function isCurrentUser(pubkey) {
|
2024-10-15 11:31:46 +02:00
|
|
|
return d.userProfileInst.pubKey === pubkey
|
2022-03-09 11:27:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayName(name, pubkey) {
|
|
|
|
return isCurrentUser(pubkey) ? qsTr("You") : name
|
|
|
|
}
|
|
|
|
|
2023-05-02 11:37:12 +02:00
|
|
|
function myPublicKey() {
|
2024-10-15 11:31:46 +02:00
|
|
|
return d.userProfileInst.pubKey
|
2023-04-06 17:23:19 +03:00
|
|
|
}
|
|
|
|
|
2022-06-02 19:48:10 +02:00
|
|
|
function createCommunity(args = {
|
|
|
|
name: "",
|
|
|
|
description: "",
|
|
|
|
introMessage: "",
|
|
|
|
outroMessage: "",
|
|
|
|
color: "",
|
2022-06-09 17:59:54 +03:00
|
|
|
tags: "",
|
2022-06-02 19:48:10 +02:00
|
|
|
image: {
|
|
|
|
src: "",
|
|
|
|
AX: 0,
|
|
|
|
AY: 0,
|
|
|
|
BX: 0,
|
|
|
|
BY: 0,
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
historyArchiveSupportEnabled: false,
|
|
|
|
checkedMembership: false,
|
2022-10-07 12:33:23 -04:00
|
|
|
pinMessagesAllowedForMembers: false,
|
|
|
|
encrypted: false
|
2022-08-17 14:44:53 +02:00
|
|
|
},
|
|
|
|
bannerJsonStr: ""
|
2022-06-02 19:48:10 +02:00
|
|
|
}) {
|
|
|
|
return communitiesModuleInst.createCommunity(
|
2022-06-09 17:59:54 +03:00
|
|
|
args.name, args.description, args.introMessage, args.outroMessage,
|
|
|
|
args.options.checkedMembership, args.color, args.tags,
|
2022-06-02 19:48:10 +02:00
|
|
|
args.image.src, args.image.AX, args.image.AY, args.image.BX, args.image.BY,
|
2022-10-07 12:33:23 -04:00
|
|
|
args.options.historyArchiveSupportEnabled, args.options.pinMessagesAllowedForMembers,
|
|
|
|
args.bannerJsonStr, args.options.encrypted);
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
2022-02-02 18:54:28 +01:00
|
|
|
|
2022-01-25 23:39:20 +03:00
|
|
|
function createCommunityCategory(categoryName, channels) {
|
|
|
|
chatCommunitySectionModule.createCommunityCategory(categoryName, channels)
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-02-01 11:31:05 -04:00
|
|
|
function editCommunityCategory(categoryId, categoryName, channels) {
|
|
|
|
chatCommunitySectionModule.editCommunityCategory(categoryId, categoryName, channels);
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function deleteCommunityCategory(categoryId) {
|
2022-01-31 20:32:53 -04:00
|
|
|
chatCommunitySectionModule.deleteCommunityCategory(categoryId);
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-02-01 11:31:05 -04:00
|
|
|
function prepareEditCategoryModel(categoryId) {
|
|
|
|
chatCommunitySectionModule.prepareEditCategoryModel(categoryId);
|
2022-02-09 10:43:23 +01:00
|
|
|
}
|
2022-02-01 11:31:05 -04:00
|
|
|
|
2022-01-18 15:54:14 -05:00
|
|
|
function leaveCommunity() {
|
|
|
|
chatCommunitySectionModule.leaveCommunity();
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-02-24 16:19:11 -05:00
|
|
|
function removeUserFromCommunity(pubKey) {
|
|
|
|
chatCommunitySectionModule.removeUserFromCommunity(pubKey);
|
|
|
|
}
|
|
|
|
|
2024-03-20 11:50:10 +01:00
|
|
|
function loadCommunityMemberMessages(communityId, pubKey) {
|
|
|
|
chatCommunitySectionModule.loadCommunityMemberMessages(communityId, pubKey);
|
|
|
|
}
|
|
|
|
|
2024-02-22 12:01:01 +01:00
|
|
|
function banUserFromCommunity(pubKey, deleteAllMessages) {
|
|
|
|
chatCommunitySectionModule.banUserFromCommunity(pubKey, deleteAllMessages);
|
2022-04-07 10:49:38 -04:00
|
|
|
}
|
|
|
|
|
2022-06-28 17:03:10 +02:00
|
|
|
function unbanUserFromCommunity(pubKey) {
|
|
|
|
chatCommunitySectionModule.unbanUserFromCommunity(pubKey);
|
|
|
|
}
|
|
|
|
|
2022-03-10 14:28:37 -05:00
|
|
|
function createCommunityChannel(channelName, channelDescription, channelEmoji, channelColor,
|
2024-03-18 18:33:07 +01:00
|
|
|
categoryId, viewersCanPostReactions, hideIfPermissionsNotMet) {
|
2022-03-10 14:28:37 -05:00
|
|
|
chatCommunitySectionModule.createCommunityChannel(channelName, channelDescription,
|
2024-03-18 18:33:07 +01:00
|
|
|
channelEmoji.trim(), channelColor, categoryId, viewersCanPostReactions, hideIfPermissionsNotMet);
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-03-10 14:28:37 -05:00
|
|
|
function editCommunityChannel(chatId, newName, newDescription, newEmoji, newColor,
|
2024-03-18 18:33:07 +01:00
|
|
|
newCategory, channelPosition, viewOnlyCanAddReaction, hideIfPermissionsNotMet) {
|
2022-02-24 16:38:32 -05:00
|
|
|
chatCommunitySectionModule.editCommunityChannel(
|
|
|
|
chatId,
|
|
|
|
newName,
|
|
|
|
newDescription,
|
2022-03-07 09:56:05 -05:00
|
|
|
newEmoji,
|
2022-03-10 14:28:37 -05:00
|
|
|
newColor,
|
2022-02-24 16:38:32 -05:00
|
|
|
newCategory,
|
2024-03-13 15:13:41 -04:00
|
|
|
channelPosition,
|
2024-03-18 18:33:07 +01:00
|
|
|
viewOnlyCanAddReaction,
|
|
|
|
hideIfPermissionsNotMet
|
2022-02-24 16:38:32 -05:00
|
|
|
)
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-10-19 16:56:00 +04:00
|
|
|
function acceptRequestToJoinCommunity(requestId, communityId) {
|
|
|
|
chatCommunitySectionModule.acceptRequestToJoinCommunity(requestId, communityId)
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
|
|
|
|
2022-10-19 16:56:00 +04:00
|
|
|
function declineRequestToJoinCommunity(requestId, communityId) {
|
|
|
|
chatCommunitySectionModule.declineRequestToJoinCommunity(requestId, communityId)
|
2021-10-22 23:49:47 +03:00
|
|
|
}
|
2021-10-28 23:23:30 +03:00
|
|
|
|
2022-01-21 14:18:56 -05:00
|
|
|
function generateAlias(pk) {
|
2023-01-06 16:43:54 +01:00
|
|
|
return globalUtilsInst.generateAlias(pk);
|
2022-01-11 16:53:18 -05:00
|
|
|
}
|
|
|
|
|
2022-01-25 13:09:27 +01:00
|
|
|
function removeCommunityChat(chatId) {
|
|
|
|
chatCommunitySectionModule.removeCommunityChat(chatId)
|
2022-01-18 18:20:31 +01:00
|
|
|
}
|
2022-01-25 10:51:38 -04:00
|
|
|
|
2022-02-11 16:41:34 -05:00
|
|
|
function reorderCommunityCategories(categoryId, to) {
|
2022-01-25 10:51:38 -04:00
|
|
|
chatCommunitySectionModule.reorderCommunityCategories(categoryId, to)
|
|
|
|
}
|
|
|
|
|
2024-04-15 11:34:44 -07:00
|
|
|
function toggleCollapsedCommunityCategory(categoryId, collapsed) {
|
|
|
|
chatCommunitySectionModule.toggleCollapsedCommunityCategory(categoryId, collapsed)
|
|
|
|
}
|
|
|
|
|
2022-02-11 16:41:34 -05:00
|
|
|
function reorderCommunityChat(categoryId, chatId, to) {
|
2022-01-25 10:51:38 -04:00
|
|
|
chatCommunitySectionModule.reorderCommunityChat(categoryId, chatId, to)
|
|
|
|
}
|
2022-02-11 16:41:34 -05:00
|
|
|
|
2022-09-22 09:13:03 +02:00
|
|
|
function spectateCommunity(id, ensName) {
|
|
|
|
return communitiesModuleInst.spectateCommunity(id, ensName)
|
2022-02-11 16:41:34 -05:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:20:52 +02:00
|
|
|
function prepareKeypairsForSigning(communityId, ensName, addressesToShare = [], airdropAddress = "", editMode = false) {
|
|
|
|
communitiesModuleInst.prepareKeypairsForSigning(communityId, ensName, JSON.stringify(addressesToShare), airdropAddress, editMode)
|
|
|
|
}
|
|
|
|
|
2024-03-19 09:41:41 +01:00
|
|
|
function signProfileKeypairAndAllNonKeycardKeypairs() {
|
|
|
|
communitiesModuleInst.signProfileKeypairAndAllNonKeycardKeypairs()
|
2023-10-27 19:20:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function signSharedAddressesForKeypair(keyUid) {
|
|
|
|
communitiesModuleInst.signSharedAddressesForKeypair(keyUid)
|
|
|
|
}
|
|
|
|
|
|
|
|
function joinCommunityOrEditSharedAddresses() {
|
|
|
|
communitiesModuleInst.joinCommunityOrEditSharedAddresses()
|
2023-03-24 14:54:59 +01:00
|
|
|
}
|
|
|
|
|
2024-03-27 10:06:14 +01:00
|
|
|
function cleanJoinEditCommunityData() {
|
|
|
|
communitiesModuleInst.cleanJoinEditCommunityData()
|
|
|
|
}
|
|
|
|
|
2022-02-11 16:41:34 -05:00
|
|
|
function userCanJoin(id) {
|
|
|
|
return communitiesModuleInst.userCanJoin(id)
|
|
|
|
}
|
|
|
|
|
|
|
|
function isUserMemberOfCommunity(id) {
|
|
|
|
return communitiesModuleInst.isUserMemberOfCommunity(id)
|
|
|
|
}
|
|
|
|
|
2023-12-04 20:14:13 +01:00
|
|
|
function isMyCommunityRequestPending(id) {
|
|
|
|
return communitiesModuleInst.isMyCommunityRequestPending(id)
|
2022-02-11 16:41:34 -05:00
|
|
|
}
|
|
|
|
|
2022-10-21 13:09:17 +03:00
|
|
|
function cancelPendingRequest(id: string) {
|
|
|
|
communitiesModuleInst.cancelRequestToJoinCommunity(id)
|
|
|
|
}
|
|
|
|
|
2022-02-11 16:41:34 -05:00
|
|
|
function getSectionNameById(id) {
|
|
|
|
return communitiesList.getSectionNameById(id)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSectionByIdJson(id) {
|
|
|
|
return communitiesList.getSectionByIdJson(id)
|
|
|
|
}
|
|
|
|
|
2023-08-02 20:03:52 +04:00
|
|
|
// intervals is a string containing json array [{startTimestamp: 1690548852, startTimestamp: 1690547684}, {...}]
|
|
|
|
function collectCommunityMetricsMessagesTimestamps(intervals) {
|
|
|
|
chatCommunitySectionModule.collectCommunityMetricsMessagesTimestamps(intervals)
|
|
|
|
}
|
|
|
|
|
2023-08-03 23:30:34 +03:00
|
|
|
function collectCommunityMetricsMessagesCount(intervals) {
|
|
|
|
chatCommunitySectionModule.collectCommunityMetricsMessagesCount(intervals)
|
|
|
|
}
|
|
|
|
|
2023-11-08 14:59:45 -05:00
|
|
|
function requestCommunityInfo(id, shardCluster, shardIndex, importing = false) {
|
|
|
|
communitiesModuleInst.requestCommunityInfo(id, shardCluster, shardIndex, importing)
|
2022-09-22 19:35:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function getCommunityDetailsAsJson(id) {
|
2022-10-28 17:25:48 +03:00
|
|
|
const jsonObj = communitiesModuleInst.getCommunityDetails(id)
|
2022-09-22 19:35:18 +03:00
|
|
|
try {
|
2022-10-28 17:25:48 +03:00
|
|
|
return JSON.parse(jsonObj)
|
2022-09-22 19:35:18 +03:00
|
|
|
}
|
|
|
|
catch (e) {
|
2022-09-23 17:14:31 +03:00
|
|
|
console.warn("error parsing community by id: ", id, " error: ", e.message)
|
2022-09-22 19:35:18 +03:00
|
|
|
return {}
|
|
|
|
}
|
2022-06-20 13:39:40 +02:00
|
|
|
}
|
|
|
|
|
2022-10-28 17:25:48 +03:00
|
|
|
function getChatDetails(id) {
|
|
|
|
const jsonObj = activityCenterModule.getChatDetailsAsJson(id)
|
|
|
|
try {
|
|
|
|
return JSON.parse(jsonObj)
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
console.warn("error parsing chat by id: ", id, " error: ", e.message)
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-09 01:04:49 +01:00
|
|
|
function getPubkey() {
|
|
|
|
return userProfile.getPubKey()
|
|
|
|
}
|
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
// Needed for TX in chat for stickers and via contact
|
2024-07-03 05:55:05 +02:00
|
|
|
readonly property var accounts: walletSectionAccounts.accounts
|
2022-10-17 12:17:25 +02:00
|
|
|
property string currentCurrency: walletSection.currentCurrency
|
|
|
|
property var savedAddressesModel: walletSectionSavedAddresses.model
|
2022-07-01 13:24:32 +02:00
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
property var disabledChainIdsFromList: []
|
|
|
|
property var disabledChainIdsToList: []
|
2022-07-01 13:24:32 +02:00
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
function addRemoveDisabledFromChain(chainID, isDisabled) {
|
|
|
|
if(isDisabled) {
|
|
|
|
disabledChainIdsFromList.push(chainID)
|
2022-07-01 13:24:32 +02:00
|
|
|
}
|
|
|
|
else {
|
2022-10-17 12:17:25 +02:00
|
|
|
for(var i = 0; i < disabledChainIdsFromList.length;i++) {
|
|
|
|
if(disabledChainIdsFromList[i] === chainID) {
|
|
|
|
disabledChainIdsFromList.splice(i, 1)
|
2022-07-01 13:24:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
function addRemoveDisabledToChain(chainID, isDisabled) {
|
|
|
|
if(isDisabled) {
|
|
|
|
disabledChainIdsToList.push(chainID)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for(var i = 0; i < disabledChainIdsToList.length;i++) {
|
|
|
|
if(disabledChainIdsToList[i] === chainID) {
|
|
|
|
disabledChainIdsToList.splice(i, 1)
|
|
|
|
}
|
2022-07-01 13:24:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
function getFiatValue(balance, cryptoSymbol, fiatSymbol) {
|
|
|
|
return profileSectionModule.ensUsernamesModule.getFiatValue(balance, cryptoSymbol, fiatSymbol)
|
2022-02-09 01:04:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function acceptRequestTransaction(transactionHash, messageId, signature) {
|
|
|
|
return currentChatContentModule().inputAreaModule.acceptRequestTransaction(transactionHash, messageId, signature)
|
|
|
|
}
|
|
|
|
|
|
|
|
function acceptAddressRequest(messageId, address) {
|
|
|
|
currentChatContentModule().inputAreaModule.acceptAddressRequest(messageId, address)
|
|
|
|
}
|
|
|
|
|
|
|
|
function declineAddressRequest(messageId) {
|
|
|
|
currentChatContentModule().inputAreaModule.declineAddressRequest(messageId)
|
|
|
|
}
|
|
|
|
|
|
|
|
function declineRequest(messageId) {
|
|
|
|
currentChatContentModule().inputAreaModule.declineRequest(messageId)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getGasEthValue(gweiValue, gasLimit) {
|
|
|
|
return profileSectionModule.ensUsernamesModule.getGasEthValue(gweiValue, gasLimit)
|
|
|
|
}
|
|
|
|
|
2022-10-17 12:17:25 +02:00
|
|
|
function resolveENS(value) {
|
|
|
|
mainModuleInst.resolveENS(value, "")
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWei2Eth(wei) {
|
2023-01-06 16:43:54 +01:00
|
|
|
return globalUtilsInst.wei2Eth(wei,18)
|
2022-10-17 12:17:25 +02:00
|
|
|
}
|
|
|
|
|
2024-10-30 09:14:52 +01:00
|
|
|
function getEtherscanTxLink() {
|
|
|
|
return profileSectionModule.ensUsernamesModule.getEtherscanTxLink()
|
2022-10-17 12:17:25 +02:00
|
|
|
}
|
|
|
|
|
2023-03-30 12:42:28 +03:00
|
|
|
function getLoginType() {
|
2024-10-15 11:31:46 +02:00
|
|
|
if(!d.userProfileInst)
|
2023-03-30 12:42:28 +03:00
|
|
|
return Constants.LoginType.Password
|
|
|
|
|
2024-10-15 11:31:46 +02:00
|
|
|
if(d.userProfileInst.usingBiometricLogin)
|
2023-03-30 12:42:28 +03:00
|
|
|
return Constants.LoginType.Biometrics
|
2024-10-15 11:31:46 +02:00
|
|
|
if(d.userProfileInst.isKeycardUser)
|
2023-03-30 12:42:28 +03:00
|
|
|
return Constants.LoginType.Keycard
|
2023-07-04 17:11:41 +02:00
|
|
|
return Constants.LoginType.Password
|
2023-03-30 12:42:28 +03:00
|
|
|
}
|
|
|
|
|
2022-11-28 15:57:56 +01:00
|
|
|
readonly property Connections communitiesModuleConnections: Connections {
|
|
|
|
target: communitiesModuleInst
|
|
|
|
function onImportingCommunityStateChanged(communityId, state, errorMsg) {
|
|
|
|
root.importingCommunityStateChanged(communityId, state, errorMsg)
|
|
|
|
}
|
2023-05-24 15:06:43 +03:00
|
|
|
|
2023-06-08 13:01:01 +02:00
|
|
|
function onCommunityAccessRequested(communityId) {
|
|
|
|
root.communityAccessRequested(communityId)
|
|
|
|
}
|
2023-07-21 11:44:10 +03:00
|
|
|
|
|
|
|
function onCommunityAdded(communityId) {
|
|
|
|
root.communityAdded(communityId)
|
|
|
|
}
|
2022-11-28 15:57:56 +01:00
|
|
|
}
|
2023-04-06 14:11:57 +03:00
|
|
|
|
|
|
|
readonly property Connections mainModuleInstConnections: Connections {
|
|
|
|
target: mainModuleInst
|
|
|
|
enabled: !!chatCommunitySectionModule
|
|
|
|
function onOpenCommunityMembershipRequestsView(sectionId: string) {
|
2023-08-02 19:39:42 +02:00
|
|
|
if(root.getMySectionId() !== sectionId)
|
2023-04-06 14:11:57 +03:00
|
|
|
return
|
|
|
|
|
|
|
|
root.goToMembershipRequestsPage()
|
|
|
|
}
|
|
|
|
}
|
2023-04-18 11:11:47 +02:00
|
|
|
|
2024-11-13 17:46:45 +01:00
|
|
|
readonly property QtObject _d: StatusQUtils.QObject {
|
2024-10-15 11:31:46 +02:00
|
|
|
id: d
|
|
|
|
|
|
|
|
readonly property var userProfileInst: userProfile
|
|
|
|
|
2023-04-18 11:11:47 +02:00
|
|
|
readonly property var sectionDetailsInstantiator: Instantiator {
|
|
|
|
model: SortFilterProxyModel {
|
|
|
|
sourceModel: mainModuleInst.sectionsModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "id"
|
|
|
|
value: chatCommunitySectionModule.getMySectionId()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delegate: QtObject {
|
|
|
|
readonly property string id: model.id
|
|
|
|
readonly property int sectionType: model.sectionType
|
|
|
|
readonly property string name: model.name
|
2023-08-02 19:39:42 +02:00
|
|
|
readonly property string image: model.image
|
2023-04-18 11:11:47 +02:00
|
|
|
readonly property bool joined: model.joined
|
|
|
|
readonly property bool amIBanned: model.amIBanned
|
2024-04-25 11:47:40 +02:00
|
|
|
readonly property string introMessage: model.introMessage
|
2023-04-18 11:11:47 +02:00
|
|
|
// add others when needed..
|
|
|
|
}
|
|
|
|
}
|
2023-04-28 13:28:19 +03:00
|
|
|
|
|
|
|
readonly property string activeChatId: chatCommunitySectionModule && chatCommunitySectionModule.activeItem ? chatCommunitySectionModule.activeItem.id : ""
|
|
|
|
readonly property int activeChatType: chatCommunitySectionModule && chatCommunitySectionModule.activeItem ? chatCommunitySectionModule.activeItem.type : -1
|
|
|
|
readonly property bool amIMember: chatCommunitySectionModule ? chatCommunitySectionModule.amIMember : false
|
|
|
|
|
|
|
|
property var oneToOneChatContact: undefined
|
2024-10-15 11:31:46 +02:00
|
|
|
readonly property string oneToOneChatContactName: !!d.oneToOneChatContact ? ProfileUtils.displayName(d.oneToOneChatContact.localNickname,
|
|
|
|
d.oneToOneChatContact.name,
|
|
|
|
d.oneToOneChatContact.displayName,
|
|
|
|
d.oneToOneChatContact.alias) : ""
|
2023-04-28 13:28:19 +03:00
|
|
|
|
2024-11-13 17:46:45 +01:00
|
|
|
StatusQUtils.ModelEntryChangeTracker {
|
|
|
|
model: root.contactsStore.contactsModel
|
|
|
|
role: "pubKey"
|
|
|
|
key: d.activeChatId
|
2023-04-28 13:28:19 +03:00
|
|
|
|
2024-11-13 17:46:45 +01:00
|
|
|
onItemChanged: d.oneToOneChatContact = Utils.getContactDetailsAsJson(d.activeChatId, false)
|
2023-04-28 13:28:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
readonly property bool isUserAllowedToSendMessage: {
|
2024-10-15 11:31:46 +02:00
|
|
|
if (d.activeChatType === Constants.chatType.oneToOne && d.oneToOneChatContact) {
|
|
|
|
return d.oneToOneChatContact.contactRequestState === Constants.ContactRequestState.Mutual
|
|
|
|
} else if (d.activeChatType === Constants.chatType.privateGroupChat) {
|
|
|
|
return d.amIMember
|
|
|
|
} else if (d.activeChatType === Constants.chatType.communityChat) {
|
2024-06-03 15:06:34 -04:00
|
|
|
return currentChatContentModule().chatDetails.canPost
|
2023-04-28 13:28:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property string chatInputPlaceHolderText: {
|
2024-10-15 11:31:46 +02:00
|
|
|
if(!d.isUserAllowedToSendMessage && d.activeChatType === Constants.chatType.privateGroupChat) {
|
2023-04-28 13:28:19 +03:00
|
|
|
return qsTr("You need to be a member of this group to send messages")
|
2024-10-15 11:31:46 +02:00
|
|
|
} else if(!d.isUserAllowedToSendMessage && d.activeChatType === Constants.chatType.oneToOne) {
|
|
|
|
return qsTr("Add %1 as a contact to send a message").arg(d.oneToOneChatContactName)
|
2023-04-28 13:28:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return qsTr("Message")
|
|
|
|
}
|
|
|
|
|
|
|
|
//Update oneToOneChatContact when activeChat id changes
|
|
|
|
Binding on oneToOneChatContact {
|
2024-10-15 11:31:46 +02:00
|
|
|
when: d.activeChatId && d.activeChatType === Constants.chatType.oneToOne
|
|
|
|
value: Utils.getContactDetailsAsJson(d.activeChatId, false)
|
2023-04-28 13:28:19 +03:00
|
|
|
restoreMode: Binding.RestoreBindingOrValue
|
|
|
|
}
|
2023-04-18 11:11:47 +02:00
|
|
|
}
|
2023-08-22 00:54:57 +06:00
|
|
|
|
|
|
|
function updatePermissionsModel(communityId, sharedAddresses) {
|
|
|
|
communitiesModuleInst.checkPermissions(communityId, JSON.stringify(sharedAddresses))
|
|
|
|
}
|
2024-09-06 11:55:44 -04:00
|
|
|
|
|
|
|
function removeMemberFromGroupChat(publicKey) {
|
|
|
|
const chatId = chatCommunitySectionModule.activeItem.id
|
|
|
|
chatCommunitySectionModule.removeMemberFromGroupChat("", chatId, publicKey)
|
|
|
|
}
|
2021-10-01 18:58:36 +03:00
|
|
|
}
|