sms

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PacketTypeSMSMessages       = "kdeconnect.sms.messages"
	PacketTypeSMSRequest        = "kdeconnect.sms.request"
	PacketTypeSMSRequestConvs   = "kdeconnect.sms.request_conversations"
	PacketTypeSMSRequestConv    = "kdeconnect.sms.request_conversation"
	PacketTypeSMSRequestAtt     = "kdeconnect.sms.request_attachment"
	PacketTypeSMSAttachmentFile = "kdeconnect.sms.attachment_file"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentFileBody added in v1.11.0

type AttachmentFileBody struct {
	Filename string `json:"filename"`
	ThreadID int64  `json:"thread_id,omitempty"`
}

type SMSAddress added in v1.11.0

type SMSAddress struct {
	Address string `json:"address"`
}

type SMSAttachment added in v1.11.0

type SMSAttachment struct {
	PartID           int64  `json:"part_id"`
	MimeType         string `json:"mime_type"`
	EncodedThumbnail string `json:"encoded_thumbnail,omitempty"`
	UniqueIdentifier string `json:"unique_identifier"`
}

type SMSMessage added in v1.11.0

type SMSMessage struct {
	Event       int             `json:"event"`
	Body        string          `json:"body"`
	Addresses   []SMSAddress    `json:"addresses"`
	Date        int64           `json:"date"`
	Type        int             `json:"type"`
	ThreadID    int64           `json:"thread_id"`
	Read        bool            `json:"read"`
	UID         int64           `json:"u_id,omitempty"`
	SubID       int             `json:"sub_id,omitempty"`
	Attachments []SMSAttachment `json:"attachments,omitempty"`
}

type SMSMessagesPacket added in v1.11.0

type SMSMessagesPacket struct {
	Version  int          `json:"version"`
	Messages []SMSMessage `json:"messages"`
}

type SMSPlugin

type SMSPlugin struct {
	// contains filtered or unexported fields
}

SMSPlugin implements SMS sending, receiving, conversation browsing, and MMS attachment handling for KDE Connect.

func NewSMSPlugin

func NewSMSPlugin(cfg config.SMSConfig, bus *events.Bus, tlsConfig *tls.Config, logger *zap.Logger) *SMSPlugin

func (*SMSPlugin) Handle

func (p *SMSPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error

func (*SMSPlugin) IncomingTypes

func (p *SMSPlugin) IncomingTypes() []string

func (*SMSPlugin) Name

func (p *SMSPlugin) Name() string

func (*SMSPlugin) OnConnect

func (p *SMSPlugin) OnConnect(dev device.Sender)

func (*SMSPlugin) OnDisconnect

func (p *SMSPlugin) OnDisconnect(dev device.Sender)

func (*SMSPlugin) OutgoingTypes

func (p *SMSPlugin) OutgoingTypes() []string

func (*SMSPlugin) RequestAttachment added in v1.11.0

func (p *SMSPlugin) RequestAttachment(dev device.Sender, partID int64, uniqueIdentifier string) error

RequestAttachment asks the phone to send an MMS attachment file.

func (*SMSPlugin) RequestConversation added in v1.11.0

func (p *SMSPlugin) RequestConversation(dev device.Sender, threadID int64, rangeStartTimestamp int64, numberToRequest int64) error

RequestConversation asks the phone for messages in a specific thread. Pass -1 for rangeStartTimestamp or numberToRequest for no limit.

func (*SMSPlugin) RequestConversations added in v1.11.0

func (p *SMSPlugin) RequestConversations(dev device.Sender) error

RequestConversations asks the phone for a summary of all conversations.

func (*SMSPlugin) SendSMS

func (p *SMSPlugin) SendSMS(dev device.Sender, phoneNumber, message string) error

func (*SMSPlugin) Timeout

func (p *SMSPlugin) Timeout() time.Duration

Jump to

Keyboard shortcuts

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