message

package
v0.0.0-...-e9e834b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const SEARCH_LIMIT = 100

Variables

This section is empty.

Functions

func Bounds

func Bounds(c *fiber.Ctx) error

func GetMessages

func GetMessages(c *fiber.Ctx) error

func GetMessagesForUser

func GetMessagesForUser(c *fiber.Ctx) error

func GetWords

func GetWords(search string) []string

func Groups

func Groups(c *fiber.Ctx) error
func Search(c *fiber.Ctx) error

Types

type Matchedon

type Matchedon struct {
	Type string `json:"type"`
	Word string `json:"word"`
}

type Message

type Message struct {
	ID                 uint64              `json:"id" gorm:"primary_key"`
	Arrival            time.Time           `json:"arrival"`
	Date               time.Time           `json:"date"`
	Fromuser           uint64              `json:"fromuser"`
	Subject            string              `json:"subject"`
	Type               string              `json:"type"`
	Textbody           string              `json:"textbody"`
	Lat                float64             `json:"lat"`
	Lng                float64             `json:"lng"`
	Unseen             bool                `json:"unseen"`
	Availablenow       uint                `json:"availablenow"`
	Availableinitially uint                `json:"availableinitially"`
	MessageGroups      []MessageGroup      `gorm:"-" json:"groups"`
	MessageAttachments []MessageAttachment `gorm:"-" json:"attachments"`
	MessageOutcomes    []MessageOutcome    `gorm:"-" json:"outcomes"`
	MessagePromises    []MessagePromise    `gorm:"-" json:"promises"`
	Promisecount       int                 `json:"promisecount"`
	Promised           bool                `json:"promised"`
	PromisedToYou      bool                `json:"promisedtoyou"`
	MessageReply       []MessageReply      `gorm:"ForeignKey:refmsgid" json:"replies"`
	Replycount         int                 `json:"replycount"`
	MessageURL         string              `json:"url"`
	Successful         bool                `json:"successful"`
	Refchatids         []uint64            `json:"refchatids" gorm:"-"`
	Locationid         uint64              `json:"-"`
	Location           *location.Location  `json:"location" gorm:"-"`
	Item               *item.Item          `json:"item" gorm:"-"`
	Repostat           *time.Time          `json:"repostat"`
	Canrepost          bool                `json:"canrepost"`
}

func GetMessagesByIds

func GetMessagesByIds(myid uint64, ids []string) []Message

type MessageAttachment

type MessageAttachment struct {
	ID           uint64 `json:"id" gorm:"primary_key"`
	IdStr        string `json:"id,omitempty"`
	Msgid        uint64 `json:"-"`
	Path         string `json:"path"`
	Paththumb    string `json:"paththumb"`
	Archived     int    `json:"archived"`
	Externaluid2 string `json:"externaluid2"`
	Externalurl  string `json:"externalurl"`
}

func (MessageAttachment) TableName

func (MessageAttachment) TableName() string

type MessageGroup

type MessageGroup struct {
	Groupid     uint64    `json:"groupid"`
	Msgid       uint64    `json:"msgid"`
	Arrival     time.Time `json:"arrival"`
	Collection  string    `json:"collection"`
	Autoreposts uint      `json:"autoreposts"`

	// There's a slight privacy issue in returning the approval id.  Potentially we might not want users to know that
	// their messages are moderated, and we might not want to reveal the id of the moderator.  However it's a useful
	// thing to be able to show mods themselves.
	Approvedby uint64 `json:"approvedby"`
}

func (MessageGroup) TableName

func (MessageGroup) TableName() string

type MessageOutcome

type MessageOutcome struct {
	ID        uint64    `json:"id" gorm:"primary_key"`
	Msgid     uint64    `json:"msgid"`
	Timestamp time.Time `json:"timestamp"`
	Outcome   string    `json:"outcome"`
}

func (MessageOutcome) TableName

func (MessageOutcome) TableName() string

type MessagePromise

type MessagePromise struct {
	ID         uint64    `json:"id" gorm:"primary_key"`
	Msgid      uint64    `json:"msgid"`
	Userid     uint64    `json:"userid"`
	Promisedat time.Time `json:"promisedat"`
}

func (MessagePromise) TableName

func (MessagePromise) TableName() string

type MessageReply

type MessageReply struct {
	ID          uint64    `json:"id" gorm:"primary_key"`
	Userid      uint64    `json:"userid"`
	Displayname string    `json:"displayname"`
	Refmsgid    uint64    `json:"refmsgid"`
	Date        time.Time `json:"date"`
}

func (MessageReply) TableName

func (MessageReply) TableName() string

type MessageSummary

type MessageSummary struct {
	ID         uint64    `json:"id" gorm:"primary_key"`
	Hasoutcome bool      `json:"hasoutcome"`
	Successful bool      `json:"successful"`
	Promised   bool      `json:"promised"`
	Groupid    uint64    `json:"groupid"`
	Type       string    `json:"type"`
	Arrival    time.Time `json:"arrival"`
	Lat        float64   `json:"lat"`
	Lng        float64   `json:"lng"`
	Unseen     bool      `json:"unseen"`
}

type SearchResult

type SearchResult struct {
	ID        uint64    `json:"-" gorm:"primary_key"`
	Msgid     uint64    `json:"id"`
	Arrival   time.Time `json:"arrival"`
	Groupid   uint64    `json:"groupid"`
	Lat       float64   `json:"lat"`
	Lng       float64   `json:"lng"`
	Tag       string    `json:"-"`
	Word      string    `json:"word"`
	Type      string    `json:"type"`
	Matchedon Matchedon `json:"matchedon" gorm:"-"`
}

func GetWordsExact

func GetWordsExact(db *gorm.DB, words []string, limit int64, groupids []uint64, msgtype string, nelat float32, nelng float32, swlat float32, swlng float32) []SearchResult

func GetWordsSounds

func GetWordsSounds(db *gorm.DB, words []string, limit int64, groupids []uint64, msgtype string, nelat float32, nelng float32, swlat float32, swlng float32) []SearchResult

func GetWordsStarts

func GetWordsStarts(db *gorm.DB, words []string, limit int64, groupids []uint64, msgtype string, nelat float32, nelng float32, swlat float32, swlng float32) []SearchResult

func GetWordsTypo

func GetWordsTypo(db *gorm.DB, words []string, limit int64, groupids []uint64, msgtype string, nelat float32, nelng float32, swlat float32, swlng float32) []SearchResult

type Tabler

type Tabler interface {
	TableName() string
}

Jump to

Keyboard shortcuts

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