mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 01:14:29 +01:00
Fix usage and help message for sync command
This commit is contained in:
parent
20e6d9e659
commit
a112e48467
1 changed files with 5 additions and 5 deletions
10
commands.go
10
commands.go
|
@ -1063,21 +1063,21 @@ var cmdSync = &commands.FullHandler{
|
||||||
Help: commands.HelpMeta{
|
Help: commands.HelpMeta{
|
||||||
Section: HelpSectionMiscellaneous,
|
Section: HelpSectionMiscellaneous,
|
||||||
Description: "Synchronize data from WhatsApp.",
|
Description: "Synchronize data from WhatsApp.",
|
||||||
Args: "<appstate/contacts/groups/space> [--create-portals]",
|
Args: "<appstate/contacts/groups/space> [--contact-avatars] [--create-portals]",
|
||||||
},
|
},
|
||||||
RequiresLogin: true,
|
RequiresLogin: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
func fnSync(ce *WrappedCommandEvent) {
|
func fnSync(ce *WrappedCommandEvent) {
|
||||||
if len(ce.Args) == 0 {
|
|
||||||
ce.Reply("**Usage:** `sync <appstate/contacts/avatars/groups/space> [--contact-avatars] [--create-portals]`")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
args := strings.ToLower(strings.Join(ce.Args, " "))
|
args := strings.ToLower(strings.Join(ce.Args, " "))
|
||||||
contacts := strings.Contains(args, "contacts")
|
contacts := strings.Contains(args, "contacts")
|
||||||
appState := strings.Contains(args, "appstate")
|
appState := strings.Contains(args, "appstate")
|
||||||
space := strings.Contains(args, "space")
|
space := strings.Contains(args, "space")
|
||||||
groups := strings.Contains(args, "groups") || space
|
groups := strings.Contains(args, "groups") || space
|
||||||
|
if !contacts && !appState && !space && !groups {
|
||||||
|
ce.Reply("**Usage:** `sync <appstate/contacts/groups/space> [--contact-avatars] [--create-portals]`")
|
||||||
|
return
|
||||||
|
}
|
||||||
createPortals := strings.Contains(args, "--create-portals")
|
createPortals := strings.Contains(args, "--create-portals")
|
||||||
contactAvatars := strings.Contains(args, "--contact-avatars")
|
contactAvatars := strings.Contains(args, "--contact-avatars")
|
||||||
if contactAvatars && (!contacts || appState) {
|
if contactAvatars && (!contacts || appState) {
|
||||||
|
|
Loading…
Reference in a new issue