Documentation ¶
Index ¶
- Variables
- func SendFilePrepare(filename string, data []byte) (string, string, error)
- func TempDir(name string) (string, error)
- type API
- type Attachment
- type BackfillTask
- type Bridge
- type BridgeStatus
- type ChatIdentifier
- type ChatInfo
- type ChatInfoAPI
- type ConnectorCapabilities
- type Contact
- type ContactAPI
- type CreateGroupResponse
- type GroupActionType
- type Identifier
- type ItemType
- type Message
- type MessageMetadata
- type PlatformConfig
- type PushKeyRequest
- type ReadReceipt
- type RichLink
- type RichLinkAsset
- type RichLinkAssetSize
- type RichLinkAssetSource
- type RichLinkVideoAsset
- type SendMessageStatus
- type SendResponse
- type StartupSyncHookResponse
- type Tapback
- type TapbackType
- type TypingNotification
- type VenturaFeatures
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownNormalTapbackTarget = errors.New("unrecognized formatting of normal tapback target") ErrInvalidTapbackTargetPart = errors.New("tapback target part index is invalid") ErrUnknownTapbackTargetType = errors.New("unrecognized tapback target type") )
View Source
var AppleEpoch = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
View Source
var (
ErrNotLoggedIn = errors.New("you're not logged into iMessage")
)
View Source
var TempDirPermissions os.FileMode = 0700
View Source
var TempFilePermissions os.FileMode = 0640
Functions ¶
Types ¶
type API ¶
type API interface { Start(readyCallback func()) error Stop() GetMessagesSinceDate(chatID string, minDate time.Time, backfillID string) ([]*Message, error) GetMessagesBetween(chatID string, minDate, maxDate time.Time) ([]*Message, error) GetMessagesBeforeWithLimit(chatID string, before time.Time, limit int) ([]*Message, error) GetMessagesWithLimit(chatID string, limit int, backfillID string) ([]*Message, error) GetChatsWithMessagesAfter(minDate time.Time) ([]ChatIdentifier, error) GetMessage(guid string) (*Message, error) MessageChan() <-chan *Message ReadReceiptChan() <-chan *ReadReceipt TypingNotificationChan() <-chan *TypingNotification ChatChan() <-chan *ChatInfo ContactChan() <-chan *Contact MessageStatusChan() <-chan *SendMessageStatus BackfillTaskChan() <-chan *BackfillTask ContactAPI ChatInfoAPI ResolveIdentifier(identifier string) (string, error) PrepareDM(guid string) error CreateGroup(guids []string) (*CreateGroupResponse, error) SendMessage(chatID, text string, replyTo string, replyToPart int, richLink *RichLink, metadata MessageMetadata) (*SendResponse, error) SendFile(chatID, text, filename string, pathOnDisk string, replyTo string, replyToPart int, mimeType string, voiceMemo bool, metadata MessageMetadata) (*SendResponse, error) SendFileCleanup(sendFileDir string) SendTapback(chatID, targetGUID string, targetPart int, tapback TapbackType, remove bool) (*SendResponse, error) SendReadReceipt(chatID, readUpTo string) error SendTypingNotification(chatID string, typing bool) error SendMessageBridgeResult(chatID, messageID string, eventID id.EventID, success bool) SendBackfillResult(chatID, backfillID string, success bool, idMap map[string][]id.EventID) SendChatBridgeResult(guid string, mxid id.RoomID) NotifyUpcomingMessage(eventID id.EventID) PreStartupSyncHook() (StartupSyncHookResponse, error) PostStartupSyncHook() Capabilities() ConnectorCapabilities }
type Attachment ¶
type Attachment struct { GUID string `json:"guid,omitempty"` PathOnDisk string `json:"path_on_disk"` FileName string `json:"file_name"` MimeType string `json:"mime_type,omitempty"` // contains filtered or unexported fields }
func (*Attachment) Delete ¶
func (attachment *Attachment) Delete() error
func (*Attachment) GetFileName ¶
func (attachment *Attachment) GetFileName() string
func (*Attachment) GetMimeType ¶
func (attachment *Attachment) GetMimeType() string
func (*Attachment) Read ¶
func (attachment *Attachment) Read() ([]byte, error)
type BackfillTask ¶
type Bridge ¶
type Bridge interface { GetIPC() *ipc.Processor GetLog() log.Logger GetZLog() *zerolog.Logger GetConnectorConfig() *PlatformConfig PingServer() (start, serverTs, end time.Time) SendBridgeStatus(state BridgeStatus) ReIDPortal(oldGUID, newGUID string, mergeExisting bool) bool GetMessagesSince(chatGUID string, since time.Time) []string SetPushKey(req *PushKeyRequest) }
type BridgeStatus ¶
type BridgeStatus struct { StateEvent string `json:"state_event"` Timestamp int64 `json:"timestamp"` TTL int `json:"ttl"` Source string `json:"source"` Error string `json:"error,omitempty"` Message string `json:"message,omitempty"` UserID id.UserID `json:"user_id,omitempty"` RemoteID string `json:"remote_id,omitempty"` RemoteName string `json:"remote_name,omitempty"` Info map[string]interface{} `json:"info,omitempty"` }
type ChatIdentifier ¶
type ChatInfoAPI ¶
type ConnectorCapabilities ¶
type ConnectorCapabilities struct { MessageSendResponses bool SendTapbacks bool SendReadReceipts bool SendTypingNotifications bool SendCaptions bool UnsendMessages bool EditMessages bool BridgeState bool MessageStatusCheckpoints bool DeliveredStatus bool ContactChatMerging bool RichLinks bool ChatBridgeResult bool }
type Contact ¶
type Contact struct { FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Nickname string `json:"nickname,omitempty"` Avatar []byte `json:"avatar,omitempty"` Phones []string `json:"phones,omitempty"` Emails []string `json:"emails,omitempty"` UserGUID string `json:"user_guid,omitempty"` PrimaryIdentifier string `json:"primary_identifier,omitempty"` }
type ContactAPI ¶
type CreateGroupResponse ¶
type GroupActionType ¶
type GroupActionType int
const ( GroupActionAddUser GroupActionType = 0 GroupActionRemoveUser GroupActionType = 1 GroupActionSetAvatar GroupActionType = 1 GroupActionRemoveAvatar GroupActionType = 2 )
type Identifier ¶
func ParseIdentifier ¶
func ParseIdentifier(guid string) Identifier
func (Identifier) String ¶
func (id Identifier) String() string
type Message ¶
type Message struct { RowID int `json:"-"` GUID string `json:"guid"` Time time.Time `json:"-"` JSONUnixTime float64 `json:"timestamp"` Subject string `json:"subject"` Text string `json:"text"` ChatGUID string `json:"chat_guid"` JSONSenderGUID string `json:"sender_guid"` Sender Identifier `json:"-"` JSONTargetGUID string `json:"target_guid"` Target Identifier `json:"-"` // The service from the sender_guid is extracted and stored here. Service string `json:"service"` IsFromMe bool `json:"is_from_me"` IsRead bool `json:"is_read"` ReadAt time.Time `json:"-"` JSONUnixReadAt float64 `json:"read_at"` IsDelivered bool IsSent bool IsEmote bool IsAudioMessage bool `json:"is_audio_message"` IsEdited bool IsRetracted bool ReplyToGUID string `json:"thread_originator_guid,omitempty"` ReplyToPart int `json:"thread_originator_part,omitempty"` Tapback *Tapback `json:"associated_message,omitempty"` ReplyProcessed bool `json:"-"` // Deprecated: use attachments array Attachment *Attachment `json:"attachment,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` ErrorNotice string `json:"error_notice,omitempty"` ItemType ItemType `json:"item_type,omitempty"` GroupActionType GroupActionType `json:"group_action_type,omitempty"` NewGroupName string `json:"new_group_title,omitempty"` RichLink *RichLink `json:"rich_link,omitempty"` Metadata MessageMetadata `json:"metadata,omitempty"` ThreadID string `json:"thread_id,omitempty"` }
func (*Message) SenderText ¶
type MessageMetadata ¶
type MessageMetadata = map[string]interface{}
type PlatformConfig ¶
type PlatformConfig struct { Platform string `yaml:"platform"` IMRestPath string `yaml:"imessage_rest_path"` IMRestArgs []string `yaml:"imessage_rest_args"` ContactsMode string `yaml:"contacts_mode"` HackySetLocale string `yaml:"hacky_set_locale"` Environment []string `yaml:"environment"` LogIPCPayloads bool `yaml:"log_ipc_payloads"` UnixSocket string `yaml:"unix_socket"` PingInterval int64 `yaml:"ping_interval_seconds"` DeleteMediaAfterUpload bool `yaml:"delete_media_after_upload"` BlueBubblesURL string `yaml:"bluebubbles_url"` BlueBubblesPassword string `yaml:"bluebubbles_password"` }
func (*PlatformConfig) BridgeName ¶
func (pc *PlatformConfig) BridgeName() string
type PushKeyRequest ¶
type ReadReceipt ¶
type RichLink ¶
type RichLink struct { OriginalURL string `json:"originalURL,omitempty"` URL string `json:"URL,omitempty"` Title string `json:"title,omitempty"` Summary string `json:"summary,omitempty"` SelectedText string `json:"selectedText,omitempty"` SiteName string `json:"siteName,omitempty"` RelatedURL string `json:"relatedURL,omitempty"` Creator string `json:"creator,omitempty"` CreatorFacebookProfile string `json:"creatorFacebookProfile,omitempty"` CreatorTwitterUsername string `json:"creatorTwitterUsername,omitempty"` ItemType string `json:"itemType,omitempty"` Icon *RichLinkAsset `json:"icon,omitempty"` Image *RichLinkAsset `json:"image,omitempty"` Video *RichLinkVideoAsset `json:"video,omitempty"` Audio *RichLinkAsset `json:"audio,omitempty"` Images []RichLinkAsset `json:"images,omitempty"` Videos []RichLinkAsset `json:"videos,omitempty"` StreamingVideos []RichLinkAsset `json:"streamingVideos,omitempty"` Audios []RichLinkAsset `json:"audios,omitempty"` }
type RichLinkAsset ¶
type RichLinkAsset struct { MimeType string `json:"mimeType,omitempty"` AccessibilityText string `json:"accessibilityText,omitempty"` Source *RichLinkAssetSource `json:"source,omitempty"` OriginalURL string `json:"originalURL,omitempty"` Size *RichLinkAssetSize `json:"size,omitempty"` }
type RichLinkAssetSize ¶
type RichLinkAssetSource ¶
type RichLinkVideoAsset ¶
type RichLinkVideoAsset struct { HasAudio bool `json:"hasAudio,omitempty"` YouTubeURL string `json:"youTubeURL,omitempty"` StreamingURL string `json:"streamingURL,omitempty"` Asset RichLinkAsset `json:"asset"` }
type SendMessageStatus ¶
type SendResponse ¶
type StartupSyncHookResponse ¶
type StartupSyncHookResponse struct {
SkipSync bool `json:"skip_sync"`
}
type Tapback ¶
type Tapback struct { TargetGUID string `json:"target_guid"` TargetPart int `json:"-"` Remove bool `json:"-"` Type TapbackType `json:"type"` }
type TapbackType ¶
type TapbackType int
const ( TapbackLove TapbackType = iota + 2000 TapbackLike TapbackDislike TapbackLaugh TapbackEmphasis TapbackQuestion TapbackRemoveOffset = 1000 )
func TapbackFromEmoji ¶
func TapbackFromEmoji(emoji string) TapbackType
func TapbackFromName ¶
func TapbackFromName(name string) TapbackType
func (TapbackType) Emoji ¶
func (amt TapbackType) Emoji() string
func (TapbackType) Name ¶
func (amt TapbackType) Name() string
func (TapbackType) String ¶
func (amt TapbackType) String() string
type TypingNotification ¶
type VenturaFeatures ¶
type VenturaFeatures interface { UnsendMessage(chatID, targetGUID string, targetPart int) (*SendResponse, error) EditMessage(chatID, targetGUID string, newText string, targetPart int) (*SendResponse, error) }
Click to show internal directories.
Click to hide internal directories.