Unverified Commit cce4b201 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

All commands have stubs of some sort

parent 718bc4df
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -83,11 +83,16 @@ To complete the installation, please enter the login, name and ssh key for
the first user.`)
	system := storage.System{}
	system.Name, err = ask.GetLine("Enter system name: ")
	system.Name = strings.ToUpper(system.Name)
	ask.CheckErr(err)
	system.DefaultExpire, err = ask.GetInt64("Enter default expiry in days: ")
	ask.CheckErr(err)
	system.ExpireLimit, err = ask.GetInt64("Enter expiration limit in days: ")
	ask.CheckErr(err)
	system.DefaultExpire, err = ask.GetInt64("Enter default expiry in days (180): ")
	if err != nil {
		system.DefaultExpire = 180
	}
	system.ExpireLimit, err = ask.GetInt64("Enter expiration limit in days (365): ")
	if err != nil {
		system.ExpireLimit = 365
	}
	err = q.SetSystem(ctx, storage.SetSystemParams{
		Name:          system.Name,
		DefaultExpire: system.DefaultExpire,
@@ -133,7 +138,7 @@ the first user.`)
			Subject:    seedMsgs[i].Subject,
			Message:    seedMsgs[i].Message,
			CreateAt:   seedMsgs[i].Date,
			Expiration: time.Now(),
			Expiration: time.Now().UTC(),
		}))
	}

+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ func CreateMessage(author, subject, message, folder string, permanent, shutdown
		} else {
			days = min(days, sysdef.ExpireLimit)
		}
		exp := time.Now().AddDate(0, 0, int(days))
		exp := time.Now().AddDate(0, 0, int(days)).UTC()
		expiration = &exp
	}
	// TODO: replace _ with rows and check.
+5 −0
Original line number Diff line number Diff line
@@ -550,6 +550,7 @@ triple quotes. I.e. a network address of the form xxx%"address" must be
specified as xxx%"""address""".`,
		MinArgs: 1,
		MaxArgs: 10,
		Action:  ActionMail,
		Flags: dclish.Flags{
			"/SUBJECT": {
				Description: `/SUBJECT=text
@@ -801,6 +802,7 @@ If you wish to use another method for sending the mail, define
BULL_MAILER to point to a command procedure. This procedure will then be
executed  in place  of MAIL,  and the  parameters passed  to it  are the
username and subject of the message.`,
		Action: ActionRespond,
		Flags: dclish.Flags{
			"/CC": {
				Description: `/CC=user[s]
@@ -1397,6 +1399,7 @@ In order to apply this to a specific folder, first select the folder

  Format:
    SET SHOWNEW`,
				Action: ActionSetShowNew,
				Flags: dclish.Flags{
					"/ALL": {
						Description: `  Specifies that the SET SHOWNEW option is the default for all users for
@@ -1422,6 +1425,7 @@ In order to apply this to a specific folder, first select the folder

  Format:
    SET NOSHOWNEW`,
				Action: ActionSetNoShowNew,
				Flags: dclish.Flags{
					"/ALL": {
						Description: `  Specifies that the  SET NOSHOWNEW option is the default  for all users
@@ -1498,6 +1502,7 @@ the SELECT command, information about that folder is shown.
			"NEW": {
				Description: `Shows folders which have new unread  messages for which BRIEF or READNEW
have been set.`,
				Action: ActionShowNew,
			},
			"PRIVILEGES": {
				Description: `Shows the  privileges necessary to  use privileged commands.  Also shows

repl/mail.go

0 → 100644
+38 −0
Original line number Diff line number Diff line
package repl

import (
	"fmt"

	"git.lyda.ie/kevin/bulletin/dclish"
)

/*

Instead of making MAIL and FORWARD the same, why not have "MAIL" enter a mail
mode where you can read mails.

Alternatively, make "mail" just a folder like any other except set to private and make the owner that user.  Maybe have a leading colon that CREATE can't use.

Or... just get rid of the mail bit.

Or... tie it into actual smtp mail.

*/

// ActionForward handles the `FORWARD` command.
func ActionForward(_ *dclish.Command) error {
	fmt.Println("ERROR: mail system is yet TODO.")
	return nil
}

// ActionMail handles the `MAIL` command.
func ActionMail(_ *dclish.Command) error {
	fmt.Println("ERROR: mail system is yet TODO.")
	return nil
}

// ActionRespond handles the `RESPOND` command.
func ActionRespond(_ *dclish.Command) error {
	fmt.Println("ERROR: mail system is yet TODO.")
	return nil
}
+1 −7
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ func ActionAdd(cmd *dclish.Command) error {
			if err != nil {
				optExpiration = nil
			}
			exp := time.Now().AddDate(0, 0, days)
			exp := time.Now().AddDate(0, 0, days).UTC()
			optExpiration = &exp
		} else {
			optExpiration = &exp
@@ -524,12 +524,6 @@ func ActionReply(cmd *dclish.Command) error {
	return nil
}

// ActionForward handles the `FORWARD` command.
func ActionForward(cmd *dclish.Command) error {
	fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description)
	return nil
}

// ActionSeen handles the `SEEN` command.
func ActionSeen(cmd *dclish.Command) error {
	// TODO: review help.
Loading