conversation

package
v0.0.0-...-abad5f9 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageGeneric     = "Generic"
	MessageShare       = "Share"
	MessageSubscribe   = "Subscribe"
	MessageUnsubscribe = "Unsubscribe"
	MessageCall        = "Call"

	ConversationRegular      = "Regular"
	ConversationRegularGroup = "RegularGroup"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversation

type Conversation struct {
	Participants     []*Participant `json:"participants"`
	Messages         []*Message     `json:"messages"`
	Title            string         `json:"title"`
	StillParticipant bool           `json:"is_still_participant"`
	Type             string         `json:"thread_type"`
	Path             string         `json:"thread_path"`
	Image            *File          `json:"image"`
	JoinMode         *JoinMode      `json:"joinable_mode"`
}

Conversation represents a conversation with one or more Facebook user(s). It matches the data in the JSON files with a file path that looks like: messages/inbox/{convID}/message_{num}.json

func Parse

func Parse(convPath string) (*Conversation, error)

Parse takes a path to a conversation folder, and loads the data into a Conversation struct. It returns a pointer to the Conversation struct.

type File

type File struct {
	Path      string `json:"uri"`
	TimeStamp int64  `json:"creation_timestamp"`
}

File represents files sent in a message. This includes photos and stickers. File.Path is the local path to the file, relative to the path of the data directory.

type JoinMode

type JoinMode struct {
	Mode int    `json:"mode"`
	Link string `json:"link"`
}

JoinMode contains information on how a group conversation might be joined by others, and optionally includes a link to join the group conversation.

type Message

type Message struct {
	SenderName   string         `json:"sender_name"`
	TimeStampMS  int64          `json:"timestamp_ms"`
	Content      string         `json:"content"`
	Audio        []*File        `json:"audio_files"`
	Files        []*File        `json:"files"`
	Photos       []*File        `json:"photos"`
	Videos       []*File        `json:"videos"`
	Share        *SharedMedia   `json:"share"`
	Sticker      *File          `json:"sticker"`
	Reactions    []*Reaction    `json:"reactions"`
	CallDuration int64          `json:"call_duration"`
	Type         string         `json:"type"`
	Users        []*Participant `json:"users"`
	Unsent       bool           `json:"is_unsent"`
}

Message represents a message in a conversation. Some values are mutually exclusive, such as Message.Sticker and Message.Content.

type Participant

type Participant struct {
	Name string `json:"name"`
}

Participant represents a Facebook user participating in a conversation.

type Reaction

type Reaction struct {
	Emoji string `json:"reaction"`
	Actor string `json:"actor"`
}

Reaction represents a reaction to a message.

type SharedMedia

type SharedMedia struct {
	Link string `json:"link"`
}

SharedMedia represents a shared media.

Jump to

Keyboard shortcuts

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