mirror of
https://github.com/status-im/status-desktop.git
synced 2025-03-04 00:11:12 +00:00
parent
bd69d88163
commit
6c5594b576
@ -626,6 +626,18 @@ QtObject:
|
|||||||
if response.result.isNil or response.result.kind == JNull:
|
if response.result.isNil or response.result.kind == JNull:
|
||||||
error "response is invalid", methodName="editCommunityChannel"
|
error "response is invalid", methodName="editCommunityChannel"
|
||||||
|
|
||||||
|
var chatsJArr: JsonNode
|
||||||
|
if(not response.result.getProp("chats", chatsJArr)):
|
||||||
|
raise newException(RpcException, fmt"editCommunityChannel; there is no `chats` key in the response for community id: {communityId}")
|
||||||
|
|
||||||
|
for chatObj in chatsJArr:
|
||||||
|
var chatDto = chatObj.toChatDto()
|
||||||
|
|
||||||
|
self.chatService.updateOrAddChat(chatDto) # we have to update chats stored in the chat service.
|
||||||
|
|
||||||
|
let data = CommunityChatArgs(chat: chatDto)
|
||||||
|
self.events.emit(SIGNAL_COMMUNITY_CHANNEL_EDITED, data)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "Error editing community channel", msg = e.msg, communityId, channelId, methodName="editCommunityChannel"
|
error "Error editing community channel", msg = e.msg, communityId, channelId, methodName="editCommunityChannel"
|
||||||
|
|
||||||
|
@ -178,12 +178,17 @@ QtObject {
|
|||||||
chatCommunitySectionModule.createCommunityChannel(channelName, channelDescription, categoryId);
|
chatCommunitySectionModule.createCommunityChannel(channelName, channelDescription, categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function editCommunityChannel(communityId, channelId, channelName, channelDescription, channelCategoryId, popupPosition) {
|
function editCommunityChannel(chatId, newName, newDescription, newCategory, channelPosition) {
|
||||||
// TODO: pass the private value when private channels
|
// TODO: pass the private value when private channels
|
||||||
// are implemented
|
// are implemented
|
||||||
//privateSwitch.checked)
|
//privateSwitch.checked)
|
||||||
// Not Refactored Yet
|
chatCommunitySectionModule.editCommunityChannel(
|
||||||
// chatsModelInst.editCommunityChannel(communityId, channelId, channelName, channelDescription, channelCategoryId, popupPosition);
|
chatId,
|
||||||
|
newName,
|
||||||
|
newDescription,
|
||||||
|
newCategory,
|
||||||
|
channelPosition
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function acceptRequestToJoinCommunity(requestId) {
|
function acceptRequestToJoinCommunity(requestId) {
|
||||||
|
@ -172,6 +172,7 @@ ColumnLayout {
|
|||||||
chatDescription = chatContentModule.chatDetails.description
|
chatDescription = chatContentModule.chatDetails.description
|
||||||
chatType = chatContentModule.chatDetails.type
|
chatType = chatContentModule.chatDetails.type
|
||||||
chatMuted = chatContentModule.chatDetails.muted
|
chatMuted = chatContentModule.chatDetails.muted
|
||||||
|
channelPosition = chatContentModule.chatDetails.position
|
||||||
}
|
}
|
||||||
|
|
||||||
onMuteChat: {
|
onMuteChat: {
|
||||||
@ -234,6 +235,16 @@ ColumnLayout {
|
|||||||
chatDetails: chatContentModule.chatDetails
|
chatDetails: chatContentModule.chatDetails
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onEditCommunityChannel: {
|
||||||
|
root.rootStore.editCommunityChannel(
|
||||||
|
chatId,
|
||||||
|
newName,
|
||||||
|
newDescription,
|
||||||
|
newCategory,
|
||||||
|
channelPosition // TODO change this to the signal once it is modifiable
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user