Toxico (toxico v0.1.1)

Toxico bindings for ctox-core using Unifex.

Link to this section Summary

Functions

Sends a "get nodes" request to the given bootstrap node with IP, port, and public key to setup connections.

Add a friend to the friend list and send a friend request.

Add a friend without sending a friend request.

Returns a specification to start this module under a supervisor.

Add a friend without sending a friend request.

Status message of the friend

Query self client information.

Send a text chat message to an online friend.

Set the nickname for the Tox client.

Set the client's status.

Set the client's status message.

Set the client's typing status for a friend.

tox api version

Link to this section Functions

Link to this function

add_bootstrap(name, host, port, public_key)

Specs

add_bootstrap(GenServer.name(), String.t(), integer(), String.t()) ::
  :ok | {:error, :null} | {:error, :bad_host} | {:error, :port}

Sends a "get nodes" request to the given bootstrap node with IP, port, and public key to setup connections.

Link to this function

add_friend(name, address, message)

Specs

add_friend(GenServer.name(), String.t(), String) ::
  {:ok, integer()} | {:error, atom()}

Add a friend to the friend list and send a friend request.

Link to this function

add_friend_norequest(name, public_key)

Specs

add_friend_norequest(GenServer.name(), String.t()) ::
  {:ok, integer()} | {:error, atom()}

Add a friend without sending a friend request.

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

delete_friend(name, friend_number)

Specs

delete_friend(GenServer.name(), integer()) :: :ok | {:error, atom()}

Add a friend without sending a friend request.

Link to this function

friend_name(name, friend_number)

Specs

friend_name(GenServer.name(), integer()) :: {:ok, String.t()} | {:error, atom()}

Friend name

Link to this function

friend_status_message(name, friend_number)

Specs

friend_status_message(GenServer.name(), integer()) ::
  {:ok, String.t()} | {:error, atom()}

Status message of the friend

Specs

self(GenServer.name()) :: %Toxico.Self{
  address: term(),
  name: term(),
  nospam: term(),
  status: term(),
  status_message: term()
}

Query self client information.

Link to this function

send_message_friend(name, friend_number, message)

Specs

send_message_friend(GenServer.name(), integer(), String.t()) ::
  :ok | {:error, atom()}

Send a text chat message to an online friend.

Link to this function

set_name(tox, name)

Specs

set_name(GenServer.name(), String.t()) :: :ok | {:error, atom()}

Set the nickname for the Tox client.

Link to this function

set_status(tox, status)

Specs

set_status(GenServer.name(), :user_none | :user_away | :user_busy) :: :ok

Set the client's status.

Link to this function

set_status_message(tox, message)

Specs

set_status_message(GenServer.name(), String.t()) :: :ok | {:error, atom()}

Set the client's status message.

Link to this function

set_typing(name, friend_number, status)

Specs

set_typing(GenServer.name(), integer(), :start | :end) :: :ok | {:error, term()}

Set the client's typing status for a friend.

Link to this function

start_link(opts \\ [])

Specs

version(GenServer.name()) :: Version.t() | nil

tox api version