Toxico (toxico v0.1.0)

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.

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.

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

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

start_link(opts \\ [])

Specs

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

tox api version