diff --git a/commands.go b/commands.go index 3f3c80d4..496205bb 100644 --- a/commands.go +++ b/commands.go @@ -62,6 +62,7 @@ func (br *SignalBridge) RegisterCommands() { cmdDeletePortal, cmdDeleteAllPortals, cmdCleanupLostPortals, + cmdSyncPortal, ) } @@ -642,3 +643,22 @@ func fnCleanupLostPortals(ce *WrappedCommandEvent) { } ce.Reply("Finished cleaning up portals") } + +var cmdSyncPortal = &commands.FullHandler{ + Func: wrapCommand(fnSyncPortal), + Name: "sync-portal", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Sync this portal.", + }, + RequiresPortal: true, + RequiresLogin: true, + RequiresAdmin: true, +} + +func fnSyncPortal(ce *WrappedCommandEvent) { + info, _ := ce.User.Client.RetrieveGroupByID(ce.Ctx, ce.Portal.GroupID(), ce.Portal.Revision) + if info != nil { + ce.Portal.UpdateInfo(ce.Ctx, ce.User, info, ce.Portal.Revision) + } +}