socket

package
v0.0.0-...-a833e92 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskLabels = map[string]string{
	"GetContactsTask":         "452",
	"SendMessageTask":         "46",
	"ThreadMarkRead":          "21",
	"GetContactsFullTask":     "207",
	"ReportAppStateTask":      "123",
	"FetchThreadsTask":        "145",
	"FetchMessagesTask":       "228",
	"SendReactionTask":        "29",
	"DeleteMessageTask":       "33",
	"DeleteMessageMeOnlyTask": "155",
}

Functions

This section is empty.

Types

type DatabaseQuery

type DatabaseQuery struct {
	Database          int64       `json:"database"`
	LastAppliedCursor interface{} `json:"last_applied_cursor"`
	SyncParams        interface{} `json:"sync_params"`
	EpochId           int64       `json:"epoch_id"`
	DataTraceId       string      `json:"data_trace_id,omitempty"`
	Version           int64       `json:"version"`
	FailureCount      interface{} `json:"failure_count"`
}

type DeleteMessageMeOnlyTask

type DeleteMessageMeOnlyTask struct {
	ThreadKey int64  `json:"thread_key,omitempty"`
	MessageId string `json:"message_id"`
}

func (*DeleteMessageMeOnlyTask) Create

func (t *DeleteMessageMeOnlyTask) Create() (interface{}, interface{}, bool)

func (*DeleteMessageMeOnlyTask) GetLabel

func (t *DeleteMessageMeOnlyTask) GetLabel() string

type DeleteMessageTask

type DeleteMessageTask struct {
	MessageId string `json:"message_id"`
}

func (*DeleteMessageTask) Create

func (t *DeleteMessageTask) Create() (interface{}, interface{}, bool)

func (*DeleteMessageTask) GetLabel

func (t *DeleteMessageTask) GetLabel() string

type FetchMessagesTask

type FetchMessagesTask struct {
	ThreadKey            int64  `json:"thread_key"`
	Direction            int64  `json:"direction"` // 0
	ReferenceTimestampMs int64  `json:"reference_timestamp_ms"`
	ReferenceMessageId   string `json:"reference_message_id"`
	SyncGroup            int64  `json:"sync_group"` // 1
	Cursor               string `json:"cursor"`
}

func (*FetchMessagesTask) Create

func (t *FetchMessagesTask) Create() (interface{}, interface{}, bool)

func (*FetchMessagesTask) GetLabel

func (t *FetchMessagesTask) GetLabel() string

type FetchThreadsTask

type FetchThreadsTask struct {
	IsAfter                    int         `json:"is_after"`
	ParentThreadKey            int64       `json:"parent_thread_key"`
	ReferenceThreadKey         int64       `json:"reference_thread_key"`
	ReferenceActivityTimestamp int64       `json:"reference_activity_timestamp"`
	AdditionalPagesToFetch     int         `json:"additional_pages_to_fetch"`
	Cursor                     interface{} `json:"cursor"`
	MessagingTag               interface{} `json:"messaging_tag"`
	SyncGroup                  int         `json:"sync_group"`
}

func (*FetchThreadsTask) Create

func (t *FetchThreadsTask) Create() (interface{}, interface{}, bool)

func (*FetchThreadsTask) GetLabel

func (t *FetchThreadsTask) GetLabel() string

type GetContactsFullTask

type GetContactsFullTask struct {
	ContactId int64 `json:"contact_id"`
}

func (*GetContactsFullTask) Create

func (t *GetContactsFullTask) Create() (interface{}, interface{}, bool)

func (*GetContactsFullTask) GetLabel

func (t *GetContactsFullTask) GetLabel() string

type GetContactsTask

type GetContactsTask struct {
	Limit int64 `json:"limit,omitempty"`
}

func (*GetContactsTask) Create

func (t *GetContactsTask) Create() (interface{}, interface{}, bool)

func (*GetContactsTask) GetLabel

func (t *GetContactsTask) GetLabel() string

type KeyStoreData

type KeyStoreData struct {
	ParentThreadKey            int64
	MinLastActivityTimestampMs int64
	HasMoreBefore              bool
	MinThreadKey               int64
}

type QueryMetadata

type QueryMetadata struct {
	DatabaseId        int64
	SendSyncParams    bool
	LastAppliedCursor interface{}
	SyncParams        interface{}
	SyncChannel
}

type ReplyMetaData

type ReplyMetaData struct {
	ReplyMessageId  string `json:"reply_source_id"`
	ReplySourceType int64  `json:"reply_source_type"` // 1 ?
	ReplyType       int64  `json:"reply_type"`        // ?
}

type ReportAppStateTask

type ReportAppStateTask struct {
	AppState  table.AppState `json:"app_state"`
	RequestId string         `json:"request_id"`
}

func (*ReportAppStateTask) Create

func (t *ReportAppStateTask) Create() (interface{}, interface{}, bool)

func (*ReportAppStateTask) GetLabel

func (t *ReportAppStateTask) GetLabel() string

type SendMessageTask

type SendMessageTask struct {
	// If you are forwarding a message, you set the ThreadId to the thread you would like to forward it to
	ThreadId                 int64                  `json:"thread_id"`
	Otid                     string                 `json:"otid"`
	Source                   table.ThreadSourceType `json:"source"`
	SendType                 table.SendType         `json:"send_type"`
	AttachmentFBIds          []int64                `json:"attachment_fbids,omitempty"`
	SyncGroup                int64                  `json:"sync_group"`
	ReplyMetaData            *ReplyMetaData         `json:"reply_metadata,omitempty"`
	Text                     interface{}            `json:"text"`
	HotEmojiSize             int32                  `json:"hot_emoji_size,omitempty"`
	StickerId                int64                  `json:"sticker_id,omitempty"`
	InitiatingSource         table.InitiatingSource `json:"initiating_source,omitempty"`           // usually FACEBOOK_INBOX
	SkipUrlPreviewGen        int32                  `json:"skip_url_preview_gen"`                  // 0 or 1
	TextHasLinks             int32                  `json:"text_has_links"`                        // 0 or 1
	StripForwardedMsgCaption int32                  `json:"strip_forwarded_msg_caption,omitempty"` // 0 or 1
	ForwardedMsgId           string                 `json:"forwarded_msg_id,omitempty"`
	MultiTabEnv              int32                  `json:"multitab_env,omitempty"` // 0 ?
	// url to external media
	// for example:
	//
	// https://media2.giphy.com/media/fItgT774J3nWw/giphy.gif?cid=999aceaclonctzck6x9rte211fb3l24m2poepsdchan17ryd&ep=v1_gifs_trending&rid=giphy.gif&ct=g
	Url string `json:"url,omitempty"`
	// attribution app id, returned in the graphql query CometAnimatedImagePickerSearchResultsRootQuery
	AttributionAppId int64 `json:"attribution_app_id,omitempty"`
}

func (*SendMessageTask) Create

func (t *SendMessageTask) Create() (interface{}, interface{}, bool)

func (*SendMessageTask) GetLabel

func (t *SendMessageTask) GetLabel() string

type SendReactionTask

type SendReactionTask struct {
	ThreadKey       int64                  `json:"thread_key,omitempty"`
	TimestampMs     int64                  `json:"timestamp_ms"`
	MessageID       string                 `json:"message_id"`
	ActorID         int64                  `json:"actor_id"`
	Reaction        string                 `json:"reaction"` // unicode emoji (empty reaction to remove)
	ReactionStyle   interface{}            `json:"reaction_style"`
	SyncGroup       int                    `json:"sync_group"`
	SendAttribution table.ThreadSourceType `json:"send_attribution"`
}

func (*SendReactionTask) Create

func (t *SendReactionTask) Create() (interface{}, interface{}, bool)

func (*SendReactionTask) GetLabel

func (t *SendReactionTask) GetLabel() string

type SyncChannel

type SyncChannel int64
const (
	MailBox SyncChannel = 1
	Contact SyncChannel = 2
)

type SyncParams

type SyncParams struct {
	Locale string `json:"locale"`
}

type Task

type Task interface {
	GetLabel() string
	Create() (interface{}, interface{}, bool) // payload, queue_name, marshal_queuename
}

type TaskData

type TaskData struct {
	FailureCount interface{} `json:"failure_count"`
	Label        string      `json:"label,omitempty"`
	Payload      interface{} `json:"payload,omitempty"`
	QueueName    interface{} `json:"queue_name,omitempty"`
	TaskId       int64       `json:"task_id"`
}

type TaskPayload

type TaskPayload struct {
	EpochId     int64      `json:"epoch_id"`
	DataTraceId string     `json:"data_trace_id,omitempty"`
	Tasks       []TaskData `json:"tasks,omitempty"`
	VersionId   string     `json:"version_id"`
}

type ThreadMarkReadTask

type ThreadMarkReadTask struct {
	ThreadId            int64 `json:"thread_id"`
	LastReadWatermarkTs int64 `json:"last_read_watermark_ts"`
	SyncGroup           int64 `json:"sync_group"`
}

func (*ThreadMarkReadTask) Create

func (t *ThreadMarkReadTask) Create() (interface{}, interface{}, bool)

func (*ThreadMarkReadTask) GetLabel

func (t *ThreadMarkReadTask) GetLabel() string

Jump to

Keyboard shortcuts

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