o3

package module
v0.0.0-...-c57218d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: GPL-3.0 Imports: 30 Imported by: 4

README

Go Report Card

o3

Re-implementation of the Threema protocol. GoDoc here, better documentation will follow.

Documentation

Overview

Package o3 central communication unit responsible for complete exchanges (like handshake and subsequent message reception). Uses functions in packethandler and packetdispatcher to deal with incoming and outgoing messages. Errors in underlying functions bubble up as panics and have to be re- covered here, converted to go errors and returned.

Package o3 functions to prepare and send packets. All preparation required to transmit a packet takes place in the packet's respective dispatcher function. Functions from packetserializer are used to convert from struct to byte buffer form that can then be transmitted on the wire. Errors from packetserializer bubble up here in the form of panics that have to be passed on to communicationhandler for conversion to go errors.

Package o3 handler functions for individual incoming packets. All functions here are called from communicationhandler. Functions in here use packetparser to parse packets into their respective structs. Any action required upon receiving a specific packet is then per- formed within its handler like updating nonces and storing keys in the session context. Errors in underlying functions bubble up to here in the form of panics and are passed on to communicationhandler for central conversion to go errors.

Package o3 functions to convert packets from byte buffers to go structs. These functions are called from packethandler only and their task is only conversion. Errors are bubbled up the chain as panics and will be converted to go errors further up the chain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGrpID

func NewGrpID() [8]byte

NewGrpID returns a randomly generated group ID (not cryptographically secure!) TODO: Why mrand?

func NewMsgID

func NewMsgID() uint64

NewMsgID returns a randomly generated message ID (not cryptographically secure!) TODO: Why mrand?

func ReadPassword

func ReadPassword() ([]byte, error)

ReadPassword uses gopass to read a password from the command line without echoing it

Types

type AddressBook

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

AddressBook is the register of ThreemaContacts

func (*AddressBook) Add

func (a *AddressBook) Add(c ThreemaContact)

Add takes a ThreemaContact and adds it to the AddressBook

func (AddressBook) Contacts

func (a AddressBook) Contacts() map[string]ThreemaContact

Contacts returns the map of id strings to contact structs of all contacts in the address book

func (AddressBook) Get

func (a AddressBook) Get(id string) (ThreemaContact, bool)

Get returns a ThreemaContact to a given ID. It returns an empty ThreemaContact if no entry is found. The second parameter can be used to check if retrieval was successful

func (*AddressBook) Import

func (a *AddressBook) Import(contacts [][]string) error

Import takes a two-dimensional slice of strings and imports it field by field into the address book. Fields have to be in the order "ID, Name, LPK" or the function will return an error

func (*AddressBook) ImportFrom

func (a *AddressBook) ImportFrom(filename string) error

ImportFrom imports an address book stored in a CSV file

func (AddressBook) SaveTo

func (a AddressBook) SaveTo(filename string) error

SaveTo stores the AddressBook in the file with the given name in CSV format

type AudioMessage

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

AudioMessage represents an image message as sent e2e encrypted to other threema users

func NewAudioMessage

func NewAudioMessage(sc *SessionContext, recipient string, filename string) (AudioMessage, error)

NewAudioMessage returns a ImageMessage ready to be encrypted

func (AudioMessage) GetAudioData

func (am AudioMessage) GetAudioData(sc SessionContext) ([]byte, error)

GetAudioData return the decrypted audio, needs the recipients secret key

func (AudioMessage) GetPrintableContent

func (am AudioMessage) GetPrintableContent() string

GetPrintableContent returns a printable represantion of an AudioMessage

func (AudioMessage) ID

func (mh AudioMessage) ID() uint64

func (AudioMessage) PubNick

func (mh AudioMessage) PubNick() PubNick

func (AudioMessage) Recipient

func (mh AudioMessage) Recipient() IDString

func (AudioMessage) Sender

func (mh AudioMessage) Sender() IDString

func (AudioMessage) Serialize

func (am AudioMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of an AudioMessage

func (*AudioMessage) SetAudioData

func (am *AudioMessage) SetAudioData(filename string, sc SessionContext) error

SetAudioData encrypts and uploads the audio. Sets the blob info in the ImageMessage. Needs the recipients public key.

func (AudioMessage) Time

func (mh AudioMessage) Time() time.Time

type DeliveryReceiptMessage

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

DeliveryReceiptMessage represents a delivery receipt as sent e2e encrypted to other threema users when a message has been received

func NewDeliveryReceiptMessage

func NewDeliveryReceiptMessage(sc *SessionContext, recipient string, msgID uint64, msgStatus MsgStatus) (DeliveryReceiptMessage, error)

NewDeliveryReceiptMessage returns a TextMessage ready to be encrypted

func (DeliveryReceiptMessage) GetPrintableContent

func (dm DeliveryReceiptMessage) GetPrintableContent() string

GetPrintableContent returns a printable represantion of a DeliveryReceiptMessage.

func (DeliveryReceiptMessage) ID

func (mh DeliveryReceiptMessage) ID() uint64

func (DeliveryReceiptMessage) MsgID

func (dm DeliveryReceiptMessage) MsgID() uint64

MsgID returns the message id

func (DeliveryReceiptMessage) PubNick

func (mh DeliveryReceiptMessage) PubNick() PubNick

func (DeliveryReceiptMessage) Recipient

func (mh DeliveryReceiptMessage) Recipient() IDString

func (DeliveryReceiptMessage) Sender

func (mh DeliveryReceiptMessage) Sender() IDString

func (DeliveryReceiptMessage) Serialize

func (dm DeliveryReceiptMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a SeliveryReceiptMessage

func (DeliveryReceiptMessage) Status

func (dm DeliveryReceiptMessage) Status() MsgStatus

Status returns the messages status

func (DeliveryReceiptMessage) Time

func (mh DeliveryReceiptMessage) Time() time.Time

type Group

type Group struct {
	CreatorID IDString
	GroupID   [8]byte
	Name      string
	Members   []IDString
}

Group represents a Threema chat group

type GroupImageMessage

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

GroupImageMessage represents a group image message as sent e2e encrypted to other threema users

func (GroupImageMessage) GetImageData

func (im GroupImageMessage) GetImageData(sc SessionContext) ([]byte, error)

GetImageData return the decrypted Image needs the recipients secret key

func (GroupImageMessage) GroupCreator

func (gmh GroupImageMessage) GroupCreator() IDString

GroupCreator returns the ID of the groups admin/creator as string

func (GroupImageMessage) GroupID

func (gmh GroupImageMessage) GroupID() [8]byte

GroupID returns the ID of the group the message belongs to

func (GroupImageMessage) ID

func (mh GroupImageMessage) ID() uint64

func (GroupImageMessage) PubNick

func (mh GroupImageMessage) PubNick() PubNick

func (GroupImageMessage) Recipient

func (mh GroupImageMessage) Recipient() IDString

func (GroupImageMessage) Sender

func (mh GroupImageMessage) Sender() IDString

func (GroupImageMessage) Serialize

func (im GroupImageMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a GroupImageMessage

func (*GroupImageMessage) SetImageData

func (im *GroupImageMessage) SetImageData(filename string) error

SetImageData encrypts the given image symmetrically and adds it to the message

func (GroupImageMessage) Time

func (mh GroupImageMessage) Time() time.Time

type GroupManageSetImageMessage

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

GroupManageSetImageMessage represents the message sent e2e-encrypted by a group's creator to all members to set the group image

func NewGroupManageSetImageMessages

func NewGroupManageSetImageMessages(sc *SessionContext, group Group, filename string) []GroupManageSetImageMessage

NewGroupManageSetImageMessages returns a slice of GroupManageSetImageMessages ready to be encrypted

func (GroupManageSetImageMessage) GetImageData

func (im GroupManageSetImageMessage) GetImageData(sc SessionContext) ([]byte, error)

GetImageData returns the decrypted Image

func (GroupManageSetImageMessage) GroupID

func (gmh GroupManageSetImageMessage) GroupID() [8]byte

func (GroupManageSetImageMessage) ID

func (mh GroupManageSetImageMessage) ID() uint64

func (GroupManageSetImageMessage) PubNick

func (mh GroupManageSetImageMessage) PubNick() PubNick

func (GroupManageSetImageMessage) Recipient

func (mh GroupManageSetImageMessage) Recipient() IDString

func (GroupManageSetImageMessage) Sender

func (mh GroupManageSetImageMessage) Sender() IDString

func (GroupManageSetImageMessage) Serialize

func (im GroupManageSetImageMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of an ImageMessage

func (*GroupManageSetImageMessage) SetImageData

func (im *GroupManageSetImageMessage) SetImageData(filename string) error

SetImageData encrypts the given image symmetrically and adds it to the message

func (GroupManageSetImageMessage) Time

func (mh GroupManageSetImageMessage) Time() time.Time

type GroupManageSetMembersMessage

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

GroupManageSetMembersMessage represents the message sent e2e encrypted by a group's creator to all members

func NewGroupManageSetMembersMessages

func NewGroupManageSetMembersMessages(sc *SessionContext, group Group) []GroupManageSetMembersMessage

NewGroupManageSetMembersMessages returns a slice of GroupManageSetMembersMessages ready to be encrypted

func (GroupManageSetMembersMessage) GroupID

func (gmh GroupManageSetMembersMessage) GroupID() [8]byte

func (GroupManageSetMembersMessage) ID

func (mh GroupManageSetMembersMessage) ID() uint64

func (GroupManageSetMembersMessage) Members

func (gmm GroupManageSetMembersMessage) Members() []IDString

Members returns a byte slice of IDString of all members contained in the message

func (GroupManageSetMembersMessage) PubNick

func (mh GroupManageSetMembersMessage) PubNick() PubNick

func (GroupManageSetMembersMessage) Recipient

func (mh GroupManageSetMembersMessage) Recipient() IDString

func (GroupManageSetMembersMessage) Sender

func (mh GroupManageSetMembersMessage) Sender() IDString

func (GroupManageSetMembersMessage) Serialize

func (gmm GroupManageSetMembersMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a GroupManageSetMembersMessage

func (GroupManageSetMembersMessage) Time

func (mh GroupManageSetMembersMessage) Time() time.Time

type GroupManageSetNameMessage

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

GroupManageSetNameMessage represents a group management messate to set the group name

func NewGroupManageSetNameMessages

func NewGroupManageSetNameMessages(sc *SessionContext, group Group) []GroupManageSetNameMessage

NewGroupManageSetNameMessages returns a slice of GroupMenageSetNameMessages ready to be encrypted

func (GroupManageSetNameMessage) GroupID

func (gmh GroupManageSetNameMessage) GroupID() [8]byte

func (GroupManageSetNameMessage) ID

func (mh GroupManageSetNameMessage) ID() uint64

func (GroupManageSetNameMessage) Name

func (gmm GroupManageSetNameMessage) Name() string

func (GroupManageSetNameMessage) PubNick

func (mh GroupManageSetNameMessage) PubNick() PubNick

func (GroupManageSetNameMessage) Recipient

func (mh GroupManageSetNameMessage) Recipient() IDString

func (GroupManageSetNameMessage) Sender

func (mh GroupManageSetNameMessage) Sender() IDString

func (GroupManageSetNameMessage) Serialize

func (gmm GroupManageSetNameMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a GroupManageSetNameMessage

func (GroupManageSetNameMessage) Time

func (mh GroupManageSetNameMessage) Time() time.Time

type GroupMemberLeftMessage

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

GroupMemberLeftMessage represents a group leaving message

func NewGroupMemberLeftMessages

func NewGroupMemberLeftMessages(sc *SessionContext, group Group) []GroupMemberLeftMessage

NewGroupMemberLeftMessages returns a slice of GroupMemberLeftMessages ready to be encrypted

func (GroupMemberLeftMessage) GroupCreator

func (gmh GroupMemberLeftMessage) GroupCreator() IDString

GroupCreator returns the ID of the groups admin/creator as string

func (GroupMemberLeftMessage) GroupID

func (gmh GroupMemberLeftMessage) GroupID() [8]byte

GroupID returns the ID of the group the message belongs to

func (GroupMemberLeftMessage) ID

func (mh GroupMemberLeftMessage) ID() uint64

func (GroupMemberLeftMessage) PubNick

func (mh GroupMemberLeftMessage) PubNick() PubNick

func (GroupMemberLeftMessage) Recipient

func (mh GroupMemberLeftMessage) Recipient() IDString

func (GroupMemberLeftMessage) Sender

func (mh GroupMemberLeftMessage) Sender() IDString

func (GroupMemberLeftMessage) Serialize

func (gml GroupMemberLeftMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a GroupMemberLeftMessage

func (GroupMemberLeftMessage) Time

func (mh GroupMemberLeftMessage) Time() time.Time

type GroupTextMessage

type GroupTextMessage struct {
	TextMessage
	// contains filtered or unexported fields
}

GroupTextMessage represents a group text message as sent e2e encrypted to other threema users

func NewGroupTextMessages

func NewGroupTextMessages(sc *SessionContext, group Group, text string) ([]GroupTextMessage, error)

NewGroupTextMessages returns a slice of GroupMemberTextMessages ready to be encrypted

func (GroupTextMessage) GroupCreator

func (gmh GroupTextMessage) GroupCreator() IDString

GroupCreator returns the ID of the groups admin/creator as string

func (GroupTextMessage) GroupID

func (gmh GroupTextMessage) GroupID() [8]byte

GroupID returns the ID of the group the message belongs to

func (GroupTextMessage) ID

func (mh GroupTextMessage) ID() uint64

func (GroupTextMessage) PubNick

func (mh GroupTextMessage) PubNick() PubNick

func (GroupTextMessage) Recipient

func (mh GroupTextMessage) Recipient() IDString

func (GroupTextMessage) Sender

func (mh GroupTextMessage) Sender() IDString

func (GroupTextMessage) Serialize

func (gtm GroupTextMessage) Serialize() []byte

Serialize : returns byte representation of serialized group text message

func (GroupTextMessage) Time

func (mh GroupTextMessage) Time() time.Time

type IDString

type IDString [8]byte

IDString is a Threema ID string consisting of capital letters and digits.

func NewIDString

func NewIDString(ids string) IDString

NewIDString creates an IDString from the input string. There is no input verification. Callers have to ensure that ids complies with Threema's ID rules.

func (IDString) String

func (is IDString) String() string

type ImageMessage

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

ImageMessage represents an image message as sent e2e encrypted to other threema users

func NewImageMessage

func NewImageMessage(sc *SessionContext, recipient string, filename string) (ImageMessage, error)

NewImageMessage returns a ImageMessage ready to be encrypted

func (ImageMessage) GetImageData

func (im ImageMessage) GetImageData(sc SessionContext) ([]byte, error)

GetImageData return the decrypted Image needs the recipients secret key

func (ImageMessage) GetPrintableContent

func (im ImageMessage) GetPrintableContent() string

GetPrintableContent returns a printable represantion of a ImageMessage.

func (ImageMessage) ID

func (mh ImageMessage) ID() uint64

func (ImageMessage) PubNick

func (mh ImageMessage) PubNick() PubNick

func (ImageMessage) Recipient

func (mh ImageMessage) Recipient() IDString

func (ImageMessage) Sender

func (mh ImageMessage) Sender() IDString

func (ImageMessage) Serialize

func (im ImageMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of an ImageMessage

func (*ImageMessage) SetImageData

func (im *ImageMessage) SetImageData(filename string, sc SessionContext) error

SetImageData encrypts and uploads the image. Sets the blob info in the ImageMessage. Needs the recipients public key.

func (ImageMessage) Time

func (mh ImageMessage) Time() time.Time

type Message

type Message interface {

	//Sender returns the message's sender ID
	Sender() IDString

	//Serialize returns a fully serialized byte slice of the message
	Serialize() []byte
	// contains filtered or unexported methods
}

Message representing the various kinds of e2e ecrypted messages threema supports

type MsgStatus

type MsgStatus uint8

MsgStatus represents the single-byte status field of DeliveryReceiptMessage

const (
	MSGDELIVERED   MsgStatus = 0x1 //indicates message was received by peer
	MSGREAD        MsgStatus = 0x2 //indicates message was read by peer
	MSGAPPROVED    MsgStatus = 0x3 //indicates message was approved (thumb up) by peer
	MSGDISAPPROVED MsgStatus = 0x4 //indicates message was disapproved (thumb down) by peer
)

MsgStatus mock enum

type MsgType

type MsgType uint8

MsgType determines the type of message that is sent or received. Users usually won't use this directly and rather use message generator functions.

const (
	TEXTMESSAGE             MsgType = 0x1  //indicates a text message
	IMAGEMESSAGE            MsgType = 0x2  //indicates a image message
	AUDIOMESSAGE            MsgType = 0x14 //indicates a audio message
	POLLMESSAGE             MsgType = 0x15 //indicates a poll message
	LOCATIONMESSAGE         MsgType = 0x16 //indicates a location message
	FILEMESSAGE             MsgType = 0x17 //indicates a file message
	GROUPTEXTMESSAGE        MsgType = 0x41 //indicates a group text message
	GROUPIMAGEMESSAGE       MsgType = 0x43 //indicates a group image message
	GROUPSETMEMEBERSMESSAGE MsgType = 0x4A //indicates a set group member message
	GROUPSETNAMEMESSAGE     MsgType = 0x4B //indicates a set group name message
	GROUPMEMBERLEFTMESSAGE  MsgType = 0x4C //indicates a group member left message
	GROUPSETIMAGEMESSAGE    MsgType = 0x50 //indicates a group set image message
	DELIVERYRECEIPT         MsgType = 0x80 //indicates a delivery receipt sent by the threema servers
	TYPINGNOTIFICATION      MsgType = 0x90 //indicates a typing notifiaction message

)

MsgType mock enum

type PubNick

type PubNick [32]byte

PubNick is the representation of Threema's nickname field users can set

func NewPubNick

func NewPubNick(pb string) PubNick

NewPubNick creates a new PubNick from the input string. Will only take the first 32 bytes of input

func (PubNick) String

func (pn PubNick) String() string

type ReceivedMsg

type ReceivedMsg struct {
	Msg Message
	Err error
}

ReceivedMsg is a type used to transmit messages via a channel

type SessionContext

type SessionContext struct {
	ID ThreemaID

	ErrorChan chan error
	// contains filtered or unexported fields
}

SessionContext is a passable structure containing all established keys and nonces required for communication with the server

func NewSessionContext

func NewSessionContext(ID ThreemaID) SessionContext

NewSessionContext returns a new SessionContext

func (*SessionContext) ChangeGroupMembers

func (sc *SessionContext) ChangeGroupMembers(group Group, sendMsgChan chan<- Message) (err error)

ChangeGroupMembers Sends a message with the new group member list to all members

func (*SessionContext) CreateNewGroup

func (sc *SessionContext) CreateNewGroup(group Group, sendMsgChan chan<- Message) (groupID [8]byte, err error)

CreateNewGroup Creates a new group and notifies all members

func (*SessionContext) LeaveGroup

func (sc *SessionContext) LeaveGroup(group Group, sendMsgChan chan<- Message) (err error)

LeaveGroup Sends a message to all members telling them the sender left the group

func (*SessionContext) RenameGroup

func (sc *SessionContext) RenameGroup(group Group, sendMsgChan chan<- Message) (err error)

RenameGroup Sends a message with the new group name to all members

func (*SessionContext) Run

func (sc *SessionContext) Run() (chan<- Message, <-chan ReceivedMsg, error)

Run receives all enqueued Messages and writes the results to the channel passed as argument

func (*SessionContext) SendAudioMessage

func (sc *SessionContext) SendAudioMessage(recipient string, filename string, sendMsgChan chan<- Message) error

SendAudioMessage sends a Audio Message to the specified ID Enqueued messages will be received, not acknowledged and discarded Works with various audio formats threema uses some kind of mp4 but mp3 works fine

func (*SessionContext) SendGroupTextMessage

func (sc *SessionContext) SendGroupTextMessage(group Group, text string, sendMsgChan chan<- Message) (err error)

SendGroupTextMessage Sends a text message to all members

func (*SessionContext) SendImageMessage

func (sc *SessionContext) SendImageMessage(recipient string, filename string, sendMsgChan chan<- Message) error

SendImageMessage sends a Image Message to the specified ID Enqueued messages will be received, not acknowledged and discarded

func (*SessionContext) SendTextMessage

func (sc *SessionContext) SendTextMessage(recipient string, text string, sendMsgChan chan<- Message) error

SendTextMessage sends a Text Message to the specified ID Enqueued messages will be received, not acknowledged and discarded

type TextMessage

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

TextMessage represents a text message as sent e2e encrypted to other threema users

func NewTextMessage

func NewTextMessage(sc *SessionContext, recipient string, text string) (TextMessage, error)

NewTextMessage returns a TextMessage ready to be encrypted

func (TextMessage) ID

func (mh TextMessage) ID() uint64

func (TextMessage) PubNick

func (mh TextMessage) PubNick() PubNick

func (TextMessage) Recipient

func (mh TextMessage) Recipient() IDString

func (TextMessage) Sender

func (mh TextMessage) Sender() IDString

func (TextMessage) Serialize

func (tm TextMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a TextMessage

func (TextMessage) String

func (tm TextMessage) String() string

String returns the message text as string

func (TextMessage) Text

func (tm TextMessage) Text() string

Text returns the message text

func (TextMessage) Time

func (mh TextMessage) Time() time.Time

type ThreemaContact

type ThreemaContact struct {
	ID   [8]byte
	Name string
	LPK  [32]byte
}

ThreemaContact is the core contact type, comprising of an ID, a long-term public key, and an optional Name

func (ThreemaContact) String

func (tc ThreemaContact) String() string

type ThreemaID

type ThreemaID struct {
	ID       IDString
	Nick     PubNick
	LSK      [32]byte
	Contacts AddressBook
	Groups   map[IDString]map[[8]byte]Group // Groups[GroupCreator][GroupID]
}

ThreemaID is the core ID type. It contains the 8-byte ID, its corresponding 32-byte 256-bit private key, and a list of known Contacts.

func LoadIDFromFile

func LoadIDFromFile(filename string, password []byte) (ThreemaID, error)

LoadIDFromFile will open a Threema identity backup file and parse its base32-encoded encrypted ID using the provided password into a ThreemaID

func NewThreemaID

func NewThreemaID(id string, lsk [32]byte, contacts AddressBook) (ThreemaID, error)

NewThreemaID creates a ThreemaID from a given id strnig and a 256-bit private key

func ParseIDBackupString

func ParseIDBackupString(idstr string, password []byte) (ThreemaID, error)

ParseIDBackupString parses the base32-encoded encrypted ID string contained in a threema backup.

func (ThreemaID) GetPubKey

func (thid ThreemaID) GetPubKey() *[32]byte

GetPubKey generates the PK on the fly, that's ok because it's rarely needed

func (ThreemaID) SaveToFile

func (thid ThreemaID) SaveToFile(filename string, password []byte) error

SaveToFile exports a ThreemaID to the given filename encrypted with password. It uses Threema's identity export format so the backup can be re-imported both here and in the app. Note that the result will always look different even if using the same password and ID because the salt is re-generated with each backup.

func (ThreemaID) String

func (thid ThreemaID) String() string

type ThreemaRest

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

ThreemaRest provides convenient wrappers for task that require the use of Threemas REST API

func (ThreemaRest) CreateIdentity

func (tr ThreemaRest) CreateIdentity() (ThreemaID, error)

CreateIdentity generates a new NaCl Keypair, registers it with the Three servers and returns the assigned ID

func (ThreemaRest) GetContactByID

func (tr ThreemaRest) GetContactByID(thIDString IDString) (ThreemaContact, error)

GetContactByID returns a ThreemaContact containing the public key as queried from the Threema servers

type TypingNotificationMessage

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

TypingNotificationMessage represents a typing notifiaction message

func (TypingNotificationMessage) ID

func (mh TypingNotificationMessage) ID() uint64

func (TypingNotificationMessage) PubNick

func (mh TypingNotificationMessage) PubNick() PubNick

func (TypingNotificationMessage) Recipient

func (mh TypingNotificationMessage) Recipient() IDString

func (TypingNotificationMessage) Sender

func (mh TypingNotificationMessage) Sender() IDString

func (TypingNotificationMessage) Serialize

func (tn TypingNotificationMessage) Serialize() []byte

Serialize returns a fully serialized byte slice of a TypingNotificationMessage

func (TypingNotificationMessage) Time

func (mh TypingNotificationMessage) Time() time.Time

Jump to

Keyboard shortcuts

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