Unverified Commit 7568b5d5 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Turn all todos into issues

Fix a few smaller ones and turn the rest into issues.
parent 3a13902f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -56,10 +56,10 @@ Top level:
SET:

  ACCESS          +ALWAYS           BRIEF            DEFAULT_EXPIRE
  EXPIRE_LIMIT     FOLDER          +NOALWAYS         NOBRIEF
  NONOTIFY         NOPROMPT_EXPIRE  NOREADNEW        NOSHOWNEW
  NOSYSTEM         NOTIFY           PROMPT_EXPIRE    READNEW
  SHOWNEW          SYSTEM
  EXPIRE_LIMIT     FOLDER           NOACCESS        +NOALWAYS
  NOBRIEF          NOPROMPT_EXPIRE  NOREADNEW        NOSHOWNEW
  NOSYSTEM         PROMPT_EXPIRE    READNEW          SHOWNEW
  SYSTEM

SHOW:

+0 −1
Original line number Diff line number Diff line
@@ -76,6 +76,5 @@ func (c Completer) Do(line []rune, pos int) ([][]rune, int) {
	}

	// Command completely typed in.
	// TODO: figure out flags.
	return newline, pos
}
+0 −2
Original line number Diff line number Diff line
@@ -115,10 +115,8 @@ func IsFolderOwner(folder, login string) bool {

// DeleteFolder deletes a folder.
func DeleteFolder(name string) error {
	// TODO: make sure user can delete this table.
	ctx := storage.Context()
	err := this.Q.DeleteFolder(ctx, name)
	// TODO: process this error a bit more to give a better error message.
	if err != nil {
		return err
	}
+19 −2
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ func CreateMessage(author, subject, message, folder string, permanent, shutdown
		exp := time.Now().AddDate(0, 0, int(days)).UTC()
		expiration = &exp
	}
	// TODO: replace _ with rows and check.
	err := this.Q.CreateMessage(ctx, storage.CreateMessageParams{
		Folder:     folder,
		Author:     author,
@@ -139,11 +138,29 @@ func LastMessage(folder string) int64 {
// ListMessages lists messages.
func ListMessages(folder string) ([]storage.Message, error) {
	ctx := storage.Context()
	// TODO: options aren't implemented - need to set them?
	rows, err := this.Q.ListMessages(ctx, folder)
	return rows, err
}

// WroteAllMessages returns true if login wrote all msgids
func WroteAllMessages(login string, msgids []int64) bool {
	ctx := storage.Context()

	for _, msgid := range msgids {
		msg, err := this.Q.GetMessage(ctx, storage.GetMessageParams{
			ID:     msgid,
			Folder: this.Folder.Name,
		})
		if err != nil {
			return false
		}
		if msg.Author != login {
			return false
		}
	}
	return true
}

// DeleteMessages deletes a list of messages.
func DeleteMessages(msgids []int64) error {
	ctx := storage.Context()
+0 −1
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ func Pager(content string) bool {
			return false
		}

		// TODO: get '/' to work for searching.
		switch key {
		case ' ': // page down
			start += pageSize
Loading