Exemplo n.º 1
0
static Messenger * init_tox()
{
  /* Init core */
  Messenger *m = initMessenger();

  /* Callbacks */
  m_callback_friendrequest(m, on_request, NULL);
  m_callback_friendmessage(m, on_message, NULL);
  m_callback_namechange(m, on_nickchange, NULL);
  m_callback_statusmessage(m, on_statuschange, NULL);
  m_callback_action(m, on_action, NULL);
#ifdef __linux__
  setname(m, (uint8_t*) "Cool guy", sizeof("Cool guy"));
#elif WIN32
  setname(m, (uint8_t*) "I should install GNU/Linux", sizeof("I should install GNU/Linux"));
#else
  setname(m, (uint8_t*) "Hipster", sizeof("Hipster"));
#endif
  return m;
}
Exemplo n.º 2
0
static Messenger *init_tox()
{
    /* Init core */
    Messenger *m = initMessenger();

    /* Callbacks */
    m_callback_friendrequest(m, on_request, NULL);
    m_callback_friendmessage(m, on_message, NULL);
    m_callback_namechange(m, on_nickchange, NULL);
    m_callback_statusmessage(m, on_statuschange, NULL);
    m_callback_action(m, on_action, NULL);
#ifdef __linux__
    setname(m, (uint8_t *) "Cool guy", sizeof("Cool guy"));
#elif defined(WIN32)
    setname(m, (uint8_t *) "I should install GNU/Linux", sizeof("I should install GNU/Linux"));
#elif defined(__APPLE__)
    setname(m, (uint8_t *) "Hipster", sizeof("Hipster")); //This used to users of other Unixes are hipsters
#else
    setname(m, (uint8_t *) "Registered Minix user #4", sizeof("Registered Minix user #4"));
#endif
    return m;
}
Exemplo n.º 3
0
/* Set the function that will be executed when an action from a friend is received.
 *  function format is: function(int32_t friendnumber, uint8_t * action, uint32_t length)
 */
void tox_callback_friend_action(Tox *tox, void (*function)(Messenger *tox, int32_t, const uint8_t *, uint16_t, void *),
                                void *userdata)
{
    Messenger *m = tox;
    m_callback_action(m, function, userdata);
}
Exemplo n.º 4
0
/* Set the function that will be executed when an action from a friend is received.
 *  function format is: function(int friendnumber, uint8_t * action, uint32_t length)
 */
void tox_callback_action(void *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), void *userdata)
{
    Messenger *m = tox;
    m_callback_action(m, function, userdata);
}
Exemplo n.º 5
0
/* Set the function that will be executed when an action from a friend is received.
 *  function format is: function(int friendnumber, size_t * action, size_t length)
 */
void tox_callback_friend_action(Tox *tox, void (*function)(Messenger *tox, int, size_t *, size_t, void *),
                                void *userdata)
{
    Messenger *m = tox;
    m_callback_action(m, function, userdata);
}