parent
0b4c465f51
commit
2a706d2b09
|
@ -318,6 +318,8 @@ QtObject:
|
|||
except Exception as e:
|
||||
error "Error removing user from the community", msg = e.msg
|
||||
|
||||
proc banUserFromCommunity*(self: CommunitiesView, pubKey: string, communityId: string) {.slot.} =
|
||||
discard self.status.chat.banUserFromCommunity(pubKey, communityId)
|
||||
|
||||
proc requestToJoinCommunity*(self: CommunitiesView, communityId: string, ensName: string) {.slot.} =
|
||||
try:
|
||||
|
|
|
@ -491,6 +491,9 @@ proc inviteUsersToCommunity*(self: ChatModel, communityId: string, pubKeys: seq[
|
|||
proc removeUserFromCommunity*(self: ChatModel, communityId: string, pubKey: string) =
|
||||
status_chat.removeUserFromCommunity(communityId, pubKey)
|
||||
|
||||
proc banUserFromCommunity*(self: ChatModel, pubKey: string, communityId: string): string =
|
||||
return status_chat.banUserFromCommunity(pubKey, communityId)
|
||||
|
||||
proc exportCommunity*(self: ChatModel, communityId: string): string =
|
||||
result = status_chat.exportCommunity(communityId)
|
||||
|
||||
|
|
|
@ -382,3 +382,9 @@ proc myPendingRequestsToJoin*(): seq[CommunityMembershipRequest] =
|
|||
communityRequests.add(jsonCommunityReqest.toCommunityMembershipRequest())
|
||||
|
||||
return communityRequests
|
||||
|
||||
proc banUserFromCommunity*(pubKey: string, communityId: string): string =
|
||||
return callPrivateRPC("banUserFromCommunity".prefix, %*[{
|
||||
"communityId": communityId,
|
||||
"user": pubKey
|
||||
}])
|
||||
|
|
|
@ -163,15 +163,16 @@ Item {
|
|||
text: qsTrId("kick")
|
||||
onTriggered: chatsModel.communities.removeUserFromCommunity(model.pubKey)
|
||||
}
|
||||
/* Action { */
|
||||
/* icon.source: "../../../img/communities/menu/ban.svg" */
|
||||
/* icon.width: 16 */
|
||||
/* icon.height: 16 */
|
||||
/* icon.color: Style.current.red */
|
||||
/* //% "Ban" */
|
||||
/* text: qsTrId("ban") */
|
||||
/* onTriggered: console.log("TODO") */
|
||||
/* } */
|
||||
Action {
|
||||
property string type: "danger"
|
||||
icon.source: "../../../img/communities/menu/ban.svg"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: Style.current.red
|
||||
//% "Ban"
|
||||
text: qsTrId("ban")
|
||||
onTriggered: chatsModel.communities.banUserFromCommunity(model.pubKey, chatsModel.communities.activeCommunity.id)
|
||||
}
|
||||
/* Separator {} */
|
||||
/* Action { */
|
||||
/* icon.source: "../../../img/communities/menu/transfer-ownership.svg" */
|
||||
|
|
Loading…
Reference in New Issue