socket

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskLabels = map[string]string{
	"ThreadMarkRead":           "21",
	"AddParticipantsTask":      "23",
	"UpdateAdminTask":          "25",
	"SendReactionTask":         "29",
	"SearchUserTask":           "30",
	"SearchUserSecondaryTask":  "31",
	"RenameThreadTask":         "32",
	"DeleteMessageTask":        "33",
	"SetThreadImageTask":       "37",
	"SendMessageTask":          "46",
	"ReportAppStateTask":       "123",
	"CreateGroupTask":          "130",
	"RemoveParticipantTask":    "140",
	"MuteThreadTask":           "144",
	"FetchThreadsTask":         "145",
	"DeleteThreadTask":         "146",
	"DeleteMessageMeOnlyTask":  "155",
	"CreatePollTask":           "163",
	"UpdatePollTask":           "164",
	"GetContactsFullTask":      "207",
	"CreateThreadTask":         "209",
	"FetchMessagesTask":        "228",
	"CreateWhatsAppThreadTask": "388",
	"GetContactsTask":          "452",
	"EditMessageTask":          "742",
}

Functions

This section is empty.

Types

type AddParticipantsTask

type AddParticipantsTask struct {
	ThreadKey  int64   `json:"thread_key"`
	ContactIDs []int64 `json:"contact_ids"`
	SyncGroup  int64   `json:"sync_group"`
}

func (*AddParticipantsTask) Create

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

func (*AddParticipantsTask) GetLabel

func (t *AddParticipantsTask) GetLabel() string

type CreateGroupPayload

type CreateGroupPayload struct {
	ThreadID int64  `json:"thread_id"`
	OTID     string `json:"otid"`
	Source   int    `json:"source"`    // 0
	SendType int    `json:"send_type"` // 8
}

type CreateGroupTask

type CreateGroupTask struct {
	Participants []int64            `json:"participants"`
	SendPayload  CreateGroupPayload `json:"send_payload"`
}

func (*CreateGroupTask) Create

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

func (*CreateGroupTask) GetLabel

func (t *CreateGroupTask) GetLabel() string

type CreatePollTask

type CreatePollTask struct {
	QuestionText string   `json:"question_text"`
	ThreadKey    int64    `json:"thread_key"`
	Options      []string `json:"options"`
	SyncGroup    int64    `json:"sync_group"`
}

func (*CreatePollTask) Create

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

func (*CreatePollTask) GetLabel

func (t *CreatePollTask) GetLabel() string

type CreateThreadTask

type CreateThreadTask struct {
	ThreadFBID                int64 `json:"thread_fbid"`
	ForceUpsert               int   `json:"force_upsert"`
	UseOpenMessengerTransport int   `json:"use_open_messenger_transport"`
	SyncGroup                 int   `json:"sync_group"`
	MetadataOnly              int   `json:"metadata_only"`
	PreviewOnly               int   `json:"preview_only"`
}

func (*CreateThreadTask) Create

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

func (*CreateThreadTask) GetLabel

func (t *CreateThreadTask) GetLabel() string

type CreateWhatsAppThreadTask

type CreateWhatsAppThreadTask struct {
	WAJID            int64            `json:"wa_jid"`
	OfflineThreadKey int64            `json:"offline_thread_key"`
	ThreadType       table.ThreadType `json:"thread_type"`
	FolderType       table.FolderType `json:"folder_type"`
	BumpTimestampMS  int64            `json:"bump_timestamp_ms"`
	TAMThreadSubtype int64            `json:"tam_thread_subtype"` // 0
}

func (*CreateWhatsAppThreadTask) Create

func (t *CreateWhatsAppThreadTask) Create() (any, any, bool)

func (*CreateWhatsAppThreadTask) GetLabel

func (t *CreateWhatsAppThreadTask) GetLabel() string

type DatabaseQuery

type DatabaseQuery struct {
	Database          int64       `json:"database"`
	LastAppliedCursor *string     `json:"last_applied_cursor"`
	SyncParams        *string     `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 DeleteThreadTask

type DeleteThreadTask struct {
	ThreadKey  int64 `json:"thread_key"`
	RemoveType int64 `json:"remove_type"`
	SyncGroup  int64 `json:"sync_group"`
}

func (*DeleteThreadTask) Create

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

func (*DeleteThreadTask) GetLabel

func (t *DeleteThreadTask) GetLabel() string

type EditMessageTask

type EditMessageTask struct {
	MessageID string `json:"message_id"`
	Text      string `json:"text"`
}

func (*EditMessageTask) Create

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

func (*EditMessageTask) GetLabel

func (t *EditMessageTask) 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 Mention

type Mention struct {
	ID     int64
	Offset int
	Length int
	Type   MentionType
}

type MentionData

type MentionData struct {
	// All fields here are comma-separated lists
	MentionIDs     string `json:"mention_ids"`
	MentionOffsets string `json:"mention_offsets"`
	MentionLengths string `json:"mention_lengths"`
	MentionTypes   string `json:"mention_types"`
}

func (*MentionData) Parse

func (md *MentionData) Parse() (Mentions, error)

type MentionType

type MentionType string
const (
	MentionTypePerson MentionType = "p"
	MentionTypeSilent MentionType = "s"
	MentionTypeThread MentionType = "t"
)

type Mentions

type Mentions []Mention

func (Mentions) Len

func (m Mentions) Len() int

func (Mentions) Less

func (m Mentions) Less(i, j int) bool

func (Mentions) Swap

func (m Mentions) Swap(i, j int)

func (Mentions) ToData

func (m Mentions) ToData() MentionData

type MuteThreadTask

type MuteThreadTask struct {
	ThreadKey        int64 `json:"thread_key"`
	MailboxType      int64 `json:"mailbox_type"` // 0
	MuteExpireTimeMS int64 `json:"mute_expire_time_ms"`
	SyncGroup        int64 `json:"sync_group"` // 1
}

func (*MuteThreadTask) Create

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

func (*MuteThreadTask) GetLabel

func (t *MuteThreadTask) GetLabel() string

type QueryMetadata

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

type RemoveParticipantTask

type RemoveParticipantTask struct {
	ThreadID  int64 `json:"thread_id"`
	ContactID int64 `json:"contact_id"`
}

func (*RemoveParticipantTask) Create

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

func (*RemoveParticipantTask) GetLabel

func (t *RemoveParticipantTask) GetLabel() string

type RenameThreadTask

type RenameThreadTask struct {
	ThreadKey  int64  `json:"thread_key"`
	ThreadName string `json:"thread_name"`
	SyncGroup  int64  `json:"sync_group"` // 1
}

func (*RenameThreadTask) Create

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

func (*RenameThreadTask) GetLabel

func (t *RenameThreadTask) GetLabel() string

type ReplyMetaData

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

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 SearchUserTask

type SearchUserTask struct {
	Query                string             `json:"query"`
	SupportedTypes       []table.SearchType `json:"supported_types"`       // [1,3,4,2,6,7,8,9] on instagram, also 13 on messenger
	SessionID            any                `json:"session_id"`            // null
	SurfaceType          int64              `json:"surface_type"`          // 15
	SelectedParticipants []int64            `json:"selected_participants"` // null
	GroupID              *int64             `json:"group_id"`              // null
	CommunityID          *int64             `json:"community_id"`          // null
	QueryID              *int64             `json:"query_id"`              // null

	Secondary bool `json:"-"`
}

func (*SearchUserTask) Create

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

func (*SearchUserTask) GetLabel

func (t *SearchUserTask) 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                     int64                  `json:"otid,string"`
	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"`
	MentionData              *MentionData           `json:"mention_data,omitempty"`
	Text                     string                 `json:"text,omitempty"`
	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"` // 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 SetThreadImageTask

type SetThreadImageTask struct {
	ThreadKey int64 `json:"thread_key"`
	ImageID   int64 `json:"image_id"`
	SyncGroup int64 `json:"sync_group"` // 1
}

func (*SetThreadImageTask) Create

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

func (*SetThreadImageTask) GetLabel

func (t *SetThreadImageTask) 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 *int64      `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

type UpdateAdminTask

type UpdateAdminTask struct {
	ThreadKey int64 `json:"thread_key"`
	ContactID int64 `json:"contact_id"`
	IsAdmin   int   `json:"is_admin"`
}

func (*UpdateAdminTask) Create

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

func (*UpdateAdminTask) GetLabel

func (t *UpdateAdminTask) GetLabel() string

type UpdatePollTask

type UpdatePollTask struct {
	ThreadKey       int64            `json:"thread_key"`
	PollID          int64            `json:"poll_id"`
	AddedOptions    []map[string]int `json:"added_options"`
	SelectedOptions []int64          `json:"selected_options"`
	SyncGroup       int64            `json:"sync_group"`
}

func (*UpdatePollTask) Create

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

func (*UpdatePollTask) GetLabel

func (t *UpdatePollTask) GetLabel() string

Jump to

Keyboard shortcuts

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