summary refs log tree commit diff stats
path: root/handlers.go
Commit message (Collapse)AuthorAgeFilesLines
* ?page=N query addedBen Morrison2019-06-031-0/+40
|
* comments editedBen Morrison2019-05-281-1/+1
|
* removed extraneous commentsBen Morrison2019-05-271-2/+1
|
* simplified indexHandler to reference staticCacheBen Morrison2019-05-261-14/+11
| | | | sending ETag with all GET responses: sha256 of raw bytes
* caching some static assetsBen Morrison2019-05-231-20/+4
|
* configuration init changesBen Morrison2019-05-231-2/+2
|
* tuning query handlingBen Morrison2019-05-221-9/+4
|
* tuning query handlingBen Morrison2019-05-221-8/+33
|
* runtime bugs related to api outputBen Morrison2019-05-211-1/+1
|
* added cache update / db push intervals to conf;Ben Morrison2019-05-211-0/+2
| | | | | made confObj concurrency-safe via sync.RWMutex; new config values related to db/cache
* fleshed out POST handler, added remote registry listBen Morrison2019-05-211-14/+1
|
* apiEndpointHandler returning all users/statuses/mentions if no query presentBen Morrison2019-05-211-36/+21
|
* apiTagsBaseHandler returning all statuses with '#' - return all statuses ↵Ben Morrison2019-05-201-5/+10
| | | | with tags. will debug later
* removing check for zero bytes written to http.ResponseWriter - handling ↵Ben Morrison2019-05-201-8/+8
| | | | later case-by-case
* renamed files for clarityBen Morrison2019-05-201-0/+209
|
* middleware func to attach remote ip to contextBen Morrison2019-05-201-159/+0
|
* commented indexHandlerBen Morrison2019-05-131-5/+14
|
* send etag for index. sha256 of template mod time.Ben Morrison2019-05-131-1/+8
|
* template initialization addedBen Morrison2019-05-131-3/+5
|
* serving css virtually instead of directlyBen Morrison2019-05-131-7/+42
|
* staticcheck warning fixedBen Morrison2019-05-131-2/+2
|
* more stubbed testsBen Morrison2019-05-131-1/+1
|
* reorganized handlers. StrictSlash(true). handling POST /api/plain/users for ↵Ben Morrison2019-05-121-0/+14
| | | | new users
* commenting earlyBen Morrison2019-05-111-8/+19
|
* skeleton handlers respondingBen Morrison2019-05-111-1/+41
|
* stubbed out handlersBen Morrison2019-05-111-13/+17
|
* reorgBen Morrison2019-05-111-3/+2
|
* building the skeletonBen Morrison2019-05-101-0/+38
Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
package commands

import (
	"errors"

	"git.sr.ht/~sircmpwn/aerc/widgets"
	"git.sr.ht/~sircmpwn/getopt"
)

type NewAccount struct{}

func init() {
	register(NewAccount{})
}

func (NewAccount) Aliases() []string {
	return []string{"new-account"}
}

func (NewAccount) Complete(aerc *widgets.Aerc, args []string) []string {
	return nil
}

func (NewAccount) Execute(aerc *widgets.Aerc, args []string) error {
	opts, _, err := getopt.Getopts(args, "t")
	if err != nil {
		return errors.New("Usage: new-account [-t]")
	}
	wizard := widgets.NewAccountWizard(aerc.Config(), aerc)
	for _, opt := range opts {
		switch opt.Option {
		case 't':
			wizard.ConfigureTemporaryAccount(true)
		}
	}
	aerc.NewTab(wizard, "New account")
	return nil
}