borogove
created pr with
borogove/muc-create.1
added borogove/muc-create.2
1: 7eacfb3 < -: ------- Initial channel creation
2: 4b5a982 ! 1: d85d8d1 review
3: 8c9556b < -: ------- Support intant room creation
4: 941aad7 < -: ------- Add tests
added borogove/muc-create.3
-: ------- > 1: 0aa766b Initial channel creation
1: d85d8d1 ! 2: a7f33d5 After config form is submitted, creation is complete
-: ------- > 3: e6042b0 Support intant room creation
-: ------- > 4: 366bac7 Add tests
-: ------- > 5: fece298 review
-: ------- > 6: 322b2bd Review replies
added borogove/muc-create.4
1: 0aa766b = 1: 0aa766b Initial channel creation
2: a7f33d5 = 2: a7f33d5 After config form is submitted, creation is complete
3: e6042b0 = 3: e6042b0 Support intant room creation
4: 366bac7 ! 4: 0da1c7e Add tests
5: fece298 = 5: 86bad8e review
6: 322b2bd = 6: 997cf5a Review replies
commented
lgtm!
cmds
checkout latest patchset:
ssh pr.pico.sh pull borogove:muc-create | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull borogove:muc-create [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh borogove:muc-createadd comment to patch request:
ssh pr.pico.sh comment borogove:muc-create "lgtm!"
Patchset
borogove/muc-create.1
After config form is submitted, creation is complete
Stephen Paul Weber
2026-10-28T19:56:35ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(2 files skipped: unsupported file type)
+15
-1
borogove/Chat.hx
#
| ... | ... | @@ -1657,6 +1657,19 @@ class Channel extends Chat { | |
| 1657 | 1657 | } | |
| 1658 | 1658 | } | |
| 1659 | 1659 | ||
| 1660 | + | @:allow(borogove) | |
| 1661 | + | private function completeCreation(): Void { | |
| 1662 | + | if (uiState != Creating) return; | |
| 1663 | + | ||
| 1664 | + | uiState = Open; | |
| 1665 | + | outbox.start(); | |
| 1666 | + | client.channelPinger.schedule(this); | |
| 1667 | + | persistence.storeChats(client.accountId(), [this]); | |
| 1668 | + | persistence.storeMembers(client.accountId(), chatId, [self]).then(_ -> trigger("members/update", [self])); | |
| 1669 | + | client.sortChats(); | |
| 1670 | + | client.trigger("chats/update", [this]); | |
| 1671 | + | } | |
| 1672 | + | ||
| 1660 | 1673 | private function selfPingSuccess() { | |
| 1661 | 1674 | if (nickInUse() != client.displayName()) { | |
| 1662 | 1675 | final desiredFullJid = JID.parse(chatId).withResource(client.displayName()); |
| ... | ... | @@ -1785,7 +1798,8 @@ class Channel extends Chat { | |
| 1785 | 1798 | override public function commands(): Promise<Array<Command>> { | |
| 1786 | 1799 | return super.commands().then((cmds: Array<Command>) -> { | |
| 1787 | 1800 | if (isOwner()) { | |
| 1788 | - | cmds.push(new MucSettingsCommand(client, JID.parse(chatId))); | |
| 1801 | + | final onCompleted = uiState == Creating ? () -> completeCreation() : null; | |
| 1802 | + | cmds.push(new MucSettingsCommand(client, JID.parse(chatId), onCompleted)); | |
| 1789 | 1803 | } | |
| 1790 | 1804 | return cmds; | |
| 1791 | 1805 | }); |
+12
-1
borogove/MucSettingsCommand.hx
#
| ... | ... | @@ -12,9 +12,19 @@ import HaxeCBridge; | |
| 12 | 12 | #end | |
| 13 | 13 | ||
| 14 | 14 | class MucSettingsCommand extends Command { | |
| 15 | + | private var onCompleted: Null<()->Void>; | |
| 16 | + | ||
| 15 | 17 | @:allow(borogove) | |
| 16 | - | public function new(client: Client, jid: JID) { | |
| 18 | + | public function new(client: Client, jid: JID, ?onCompleted: ()->Void) { | |
| 17 | 19 | super(client, { jid: jid, name: "Settings", node: "muc-settings" }); | |
| 20 | + | this.onCompleted = onCompleted; | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | @:allow(borogove.MucSettingsCommandSession) | |
| 24 | + | private function notifyCompleted() { | |
| 25 | + | final cb = onCompleted; | |
| 26 | + | onCompleted = null; | |
| 27 | + | if (cb != null) cb(); | |
| 18 | 28 | } | |
| 19 | 29 | ||
| 20 | 30 | override public function execute(): Promise<CommandSession> { |
| ... | ... | @@ -82,6 +92,7 @@ class MucSettingsCommandSession extends CommandSession { | |
| 82 | 92 | return; | |
| 83 | 93 | } | |
| 84 | 94 | ||
| 95 | + | Util.downcast(this.command, MucSettingsCommand)?.notifyCompleted(); | |
| 85 | 96 | resolve(new MucSettingsCommandSession("completed", null, [], [], this.command)); | |
| 86 | 97 | }); | |
| 87 | 98 | this.command.client.sendQuery(q); |