msgapi

package
v0.0.0-...-2b39b34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AreasSortingDefault = "default"
	AreasSortingUnread  = "unread"
)
View Source
const (
	EchoAreaMsgTypeJAM        EchoAreaMsgType = "JAM"
	EchoAreaMsgTypeMSG        EchoAreaMsgType = "MSG"
	EchoAreaMsgTypeSquish     EchoAreaMsgType = "Squish"
	EchoAreaMsgTypePasstrough EchoAreaMsgType = "Passtrough"
	EchoAreaTypeNetmail       EchoAreaType    = 0
	EchoAreaTypeEcho          EchoAreaType    = 3
	EchoAreaTypeLocal         EchoAreaType    = 4
	EchoAreaTypeDupe          EchoAreaType    = 2
	EchoAreaTypeBad           EchoAreaType    = 1
	EchoAreaTypeNone          EchoAreaType    = 5
)

types

Variables

View Source
var (

	// Areas list
	Areas []AreaPrimitive
)

Functions

func AreaHasUnreadMessages

func AreaHasUnreadMessages(area *AreaPrimitive) bool

func Highlight

func Highlight(name string) string

Highlight self

func Lookup

func Lookup(name string) int

Lookup name->id

func Search(name string) int

Search part name->id

func SortAreas

func SortAreas()

Types

type AreaPrimitive

type AreaPrimitive interface {
	Init()
	GetCount() uint32
	GetLast() uint32
	GetMsg(position uint32) (*Message, error)
	GetName() string
	GetMsgType() EchoAreaMsgType
	GetType() EchoAreaType
	SetChrs(string)
	GetChrs() string
	SetLast(uint32)
	DelMsg(uint32) error
	SaveMsg(*Message) error
	GetMessages() *[]MessageListItem
}

AreaPrimitive interface

type EchoAreaMsgType

type EchoAreaMsgType string

EchoAreaMsgType Area msg base type

type EchoAreaType

type EchoAreaType uint8

EchoAreaType Area type

type JAM

type JAM struct {
	AreaPath, AreaName string
	AreaType           EchoAreaType
	Chrs               string
	// contains filtered or unexported fields
}

JAM struct

func (*JAM) DelMsg

func (j *JAM) DelMsg(l uint32) error

DelMsg remove msg

func (*JAM) GetChrs

func (j *JAM) GetChrs() string

GetChrs get charset

func (*JAM) GetCount

func (j *JAM) GetCount() uint32

GetCount return count messages

func (*JAM) GetLast

func (j *JAM) GetLast() uint32

GetLast return last message

func (*JAM) GetMessages

func (j *JAM) GetMessages() *[]MessageListItem

GetMessages get headers

func (*JAM) GetMsg

func (j *JAM) GetMsg(position uint32) (*Message, error)

GetMsg return msg

func (*JAM) GetMsgType

func (j *JAM) GetMsgType() EchoAreaMsgType

GetMsgType return msg base type

func (*JAM) GetName

func (j *JAM) GetName() string

GetName return area name

func (*JAM) GetType

func (j *JAM) GetType() EchoAreaType

GetType return area type

func (*JAM) Init

func (j *JAM) Init()

Init init

func (*JAM) SaveMsg

func (j *JAM) SaveMsg(tm *Message) error

SaveMsg save message

func (*JAM) SetChrs

func (j *JAM) SetChrs(c string)

SetChrs set charset

func (*JAM) SetLast

func (j *JAM) SetLast(l uint32)

SetLast set last message

type MSG

type MSG struct {
	AreaPath string
	AreaName string
	AreaType EchoAreaType
	Chrs     string
	// contains filtered or unexported fields
}

MSG struct

func (*MSG) DelMsg

func (m *MSG) DelMsg(l uint32) error

DelMsg remove msg

func (*MSG) GetChrs

func (m *MSG) GetChrs() string

GetChrs get charset

func (*MSG) GetCount

func (m *MSG) GetCount() uint32

GetCount get msg count

func (*MSG) GetLast

func (m *MSG) GetLast() uint32

GetLast get last msg number

func (*MSG) GetMessages

func (m *MSG) GetMessages() *[]MessageListItem

GetMessages get headers

func (*MSG) GetMsg

func (m *MSG) GetMsg(position uint32) (*Message, error)

GetMsg getmsg

func (*MSG) GetMsgType

func (m *MSG) GetMsgType() EchoAreaMsgType

GetMsgType return area msg base type

func (*MSG) GetName

func (m *MSG) GetName() string

GetName get areaname

func (*MSG) GetType

func (m *MSG) GetType() EchoAreaType

GetType get area type

func (*MSG) Init

func (m *MSG) Init()

Init for future

func (*MSG) SaveMsg

func (m *MSG) SaveMsg(tm *Message) error

SaveMsg save message

func (*MSG) SetChrs

func (m *MSG) SetChrs(s string)

SetChrs set charset

func (*MSG) SetLast

func (m *MSG) SetLast(l uint32)

SetLast set last message num

type MSGAttrs

type MSGAttrs uint16

MSGAttrs MSG attributes

const (
	MSGPRIVATE MSGAttrs = 0x0001
	MSGCRASH   MSGAttrs = 0x0002
	MSGREAD    MSGAttrs = 0x0004
	MSGSENT    MSGAttrs = 0x0008
	MSGFILE    MSGAttrs = 0x0010
	MSGFWD     MSGAttrs = 0x0020
	MSGORPHAN  MSGAttrs = 0x0040
	MSGKILL    MSGAttrs = 0x0080
	MSGLOCAL   MSGAttrs = 0x0100
	MSGHOLD    MSGAttrs = 0x0200
	MSGXX2     MSGAttrs = 0x0400
	MSGFRQ     MSGAttrs = 0x0800
	MSGRRQ     MSGAttrs = 0x1000
	MSGCPT     MSGAttrs = 0x2000
	MSGARQ     MSGAttrs = 0x4000
	MSGURQ     MSGAttrs = 0x8000
)

attributes

type Message

type Message struct {
	Area        string
	AreaObject  *AreaPrimitive
	MsgNum      uint32
	MaxNum      uint32
	DateWritten time.Time
	DateArrived time.Time
	Attrs       []string
	ReplyTo     uint32
	Replies     []uint32
	Body        string
	FromAddr    *types.FidoAddr
	ToAddr      *types.FidoAddr
	From        string
	To          string
	Subject     string
	Kludges     map[string]string
	Corrupted   bool
}

Message struct

func (*Message) Decode

func (m *Message) Decode()

Decode charset

func (*Message) Encode

func (m *Message) Encode()

Encode charset

func (*Message) GetForward

func (m *Message) GetForward() []string

GetForward get forward

func (*Message) GetQuote

func (m *Message) GetQuote() []string

GetQuote get quote

func (*Message) MakeBody

func (m *Message) MakeBody() *Message

MakeBody make body

func (*Message) ParseRaw

func (m *Message) ParseRaw() error

ParseRaw parse raw msg

func (*Message) ToEditAnswerView

func (m *Message) ToEditAnswerView(om *Message) string

ToEditAnswerView export view

func (*Message) ToEditForwardView

func (m *Message) ToEditForwardView(om *Message) string

ToEditForwardView export view

func (*Message) ToEditNewView

func (m *Message) ToEditNewView() string

ToEditNewView export view

func (*Message) ToView

func (m *Message) ToView(showKludges bool) string

ToView export view

type MessageListItem

type MessageListItem struct {
	MsgNum      uint32
	From        string
	To          string
	Subject     string
	DateWritten time.Time
}

MessageListItem struct

type Squish

type Squish struct {
	AreaPath string
	AreaName string
	AreaType EchoAreaType
	Chrs     string
	// contains filtered or unexported fields
}

Squish struct

func (*Squish) DelMsg

func (s *Squish) DelMsg(l uint32) error

DelMsg remove msg

func (*Squish) GetChrs

func (s *Squish) GetChrs() string

GetChrs get charset

func (*Squish) GetCount

func (s *Squish) GetCount() uint32

GetCount get messages count

func (*Squish) GetLast

func (s *Squish) GetLast() uint32

GetLast get last message number

func (*Squish) GetMessages

func (s *Squish) GetMessages() *[]MessageListItem

GetMessages get headers

func (*Squish) GetMsg

func (s *Squish) GetMsg(position uint32) (*Message, error)

GetMsg return message

func (*Squish) GetMsgType

func (s *Squish) GetMsgType() EchoAreaMsgType

GetMsgType return area msg base type

func (*Squish) GetName

func (s *Squish) GetName() string

GetName return area name

func (*Squish) GetType

func (s *Squish) GetType() EchoAreaType

GetType get area type

func (*Squish) Init

func (s *Squish) Init()

Init for future

func (*Squish) SaveMsg

func (s *Squish) SaveMsg(tm *Message) error

SaveMsg save message

func (*Squish) SetChrs

func (s *Squish) SetChrs(c string)

SetChrs set charset

func (*Squish) SetLast

func (s *Squish) SetLast(l uint32)

SetLast set last message number

type SquishAttrs

type SquishAttrs uint32

SquishAttrs Squish Attributes

const (
	SquishPRIVATE SquishAttrs = 0x0001
	SquishCRASH   SquishAttrs = 0x0002
	SquishREAD    SquishAttrs = 0x0004
	SquishSENT    SquishAttrs = 0x0008
	SquishFILE    SquishAttrs = 0x0010
	SquishFWD     SquishAttrs = 0x0020
	SquishORPHAN  SquishAttrs = 0x0040
	SquishKILL    SquishAttrs = 0x0080
	SquishLOCAL   SquishAttrs = 0x0100
	SquishHOLD    SquishAttrs = 0x0200
	SquishXX2     SquishAttrs = 0x0400
	SquishFRQ     SquishAttrs = 0x0800
	SquishRRQ     SquishAttrs = 0x1000
	SquishCPT     SquishAttrs = 0x2000
	SquishARQ     SquishAttrs = 0x4000
	SquishURQ     SquishAttrs = 0x8000
	SquishSCANNED SquishAttrs = 0x00010000
	SquishUID     SquishAttrs = 0x00020000
	SquishSEEN    SquishAttrs = 0x00080000
)

attrubutes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL