summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.h
AgeCommit message (Collapse)Author
2016-12-22Wrap all sodium/nacl functions in crypto_core.c.iphydf
2016-12-14Add option to disable local peer discoveryMaxim Biro
2016-12-03rename messenger function, prepend m_Gregory Mullen (grayhatter)
2016-11-24add NAT hole punching level to Tox APIGregory Mullen (grayhatter)
2016-11-06Move log callback to options.iphydf
Previously, all log messages generated by tox_new (which is quite a lot) were dropped, because client code had no chance to register a logging callback, yet. This change allows setting the log callback from the beginning and removes the ability to unset it. Since the log callback is forever special, since it can't be stateless, we don't necessarily need to treat it uniformly (with `event`).
2016-10-29Rename some internal "group chat" things to "conference".iphydf
This is to allow new group chats to coexist with old group chats. We do not rename everything in group.[ch] to conference, yet, because it's not currently necessary, and a general internal API overhaul is due at some point anyway.
2016-09-30Add the 'Tox' context object to the logger.iphydf
We don't currently support callbacks without context object.
2016-09-21Make group callbacks statelessJfreegman
2016-09-19Revert "Make ToxAV stateless"iphydf
This reverts commit 21f8db12c45bd56293262cd4abfb73cd9abec821. It is currently broken. Incoming call callbacks are not invoked, and instead the client goes offline immediately.
2016-09-17Make ToxAV statelessGregory Mullen (grayhatter)
2016-09-16Ensure that all TODOs have an owner.iphydf
In the future, all TODOs added either need a bug number (TODO(#NN)) or a person's github user name. By default, I made irungentoo the owner of all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner of API TODOs.
2016-09-13Use <stdbool.h> and replace _Bool with bool.iphydf
This header is a requirement for the public API, therefore is assumed to exist. It is a C99 standard library header, and _Bool is not intended to be used directly, except in legacy code that defines bool (and true/false) itself. We don't use or depend on such code. None of our client code uses or depends on such code. There is no reason to not use bool.
2016-09-10make the majority of the callbacks stateless and add some status to a testcasemichael bishop
2016-09-06Make friend requests statelessGregory Mullen (grayhatter)
Messenger is slightly twisty when it comes to sending connection status callbacks It will very likely need at the very least a partial refactor to clean it up a bit. Toxcore shouldn't need void *userdata as deep as is currently does. (amend 1) Because of the nature of toxcore connection callbacks, I decided to change this commit from statelessness for connections changes to statelessness for friend requests. It's simpler this was and doesn't include doing anything foolish in the time between commits. group fixup because grayhatter doesn't want to do it "arguably correct" is not how you write security sensitive code Clear a compiler warning about types within a function.
2016-09-01Sort #includes in all source files.iphydf
2016-08-27Move logging to a callback.iphydf
This removes the global logger (which by the way was deleted when the first tox was killed, so other toxes would then stop logging). Various bits of the code now carry a logger or pass it around. It's a bit less transparent now, but now there is no need to have a global logger, and clients can decide what to log and where.
2016-08-22Make Message received receipts statelessGregory Mullen (grayhatter)
2016-08-22Make Friend User Status statelessGregory Mullen (grayhatter)
2016-08-20Make the friend message callback statelessGregory Mullen (grayhatter)
2016-08-19Make Typing change callback statelessGregory Mullen (grayhatter)
Moved a few #defines to the top of the header for better readability
2016-08-18Make friend_status_message callback stateless.iphydf
See #40 for details.
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2016-08-17Make self_connection_status callback stateless.iphydf
**What are we doing?** We are moving towards stateless callbacks. This means that when registering a callback, you no longer pass a user data pointer. Instead, you pass a user data pointer to tox_iterate. This pointer is threaded through the code, passed to each callback. The callback can modify the data pointed at. An extra indirection will be needed if the pointer itself can change. **Why?** Currently, callbacks are registered with a user data pointer. This means the library has N pointers for N different callbacks. These pointers need to be managed by the client code. Managing the lifetime of the pointee can be difficult. In C++, it takes special effort to ensure that the lifetime of user data extends at least beyond the lifetime of the Tox instance. For other languages, the situation is much worse. Java and other garbage collected languages may move objects in memory, so the pointers are not stable. Tox4j goes through a lot of effort to make the Java/Scala user experience a pleasant one by keeping a global array of Tox+userdata on the C++ side, and communicating via protobufs. A Haskell FFI would have to do similarly complex tricks. Stateless callbacks ensure that a user data pointer only needs to live during a single function call. This means that the user code (or language runtime) can move the data around at will, as long as it sets the new location in the callback. **How?** We are doing this change one callback at a time. After each callback, we ensure that everything still works as expected. This means the toxcore change will require 15 Pull Requests.
2015-05-08Added basic TCP server hosting to tox.h api.irungentoo
TODO: tell friends we are hosting a relay and prioritize using relays hosted by friends over bootstrap ones.
2015-05-03Removed useless code.irungentoo
2015-04-30Fixed some warnings.irungentoo
Removed useless include.
2015-04-27Move LAN discovery from Messenger to friend_connection.irungentoo
2015-04-24Fixed a couple possible issues with the friend connection callback.irungentoo
A TCP callback could be received when only a UDP connection was present. Increased a UDP timeout to make it less likely to time out and switch to TCP.
2015-04-21Move the send tcp relay packet from Messenger to friend connection.irungentoo
2015-04-16Properly share connected relays and connect to the friend correctlyirungentoo
with them.
2015-04-02API function to get last seen timestamp of friendJfreegman
also removed remnants of the no longer used variable ping_lastrecv
2015-03-23Changed the share relay packet id.irungentoo
2015-03-21Transfers with filelength == 0 now behave exactly like transfers of everyirungentoo
other size (except streaming of course).
2015-03-20Allow sending of file transfer requests with length 0 but don't allocateirungentoo
any file number for them in core. These can be used to tell friends we don't have an avatar set or to unset a set avatar.
2015-03-18Merged normal message function and send action function into oneirungentoo
messaging function. This removes code duplication and allows us to easily add new message types to the api without having to add new functions.
2015-03-17Added tox_file_send_seek() function to api.irungentoo
This function can be used to seek an incoming file tranfer right before accepting it. It is meant to be used to resume incomplete file tranfers by clients.
2015-03-17Added and implemented file_id parameter to file tranfers.irungentoo
file_id is a 32byte identifier that can be used by users to identify file tranfers across core/client restarts in order to resume broken file tranfers. In avatar tranfers it corresponds to the hash of the avatar. Added tox_file_get_file_id() function to api to obtain the file_id of an ongoing file transfer. If not set, core will generate a random one.
2015-03-15Avatar hash is now the filename of the file transfer instead of theirungentoo
first 32 bytes. Enforce length of filename in core when transfer is an avatar type transfer to make things more safe.
2015-03-13File kind is now a uint32_t.irungentoo
This allows clients to agree on what numbers mean what without having it be set in core.
2015-03-13tox_file_send_chunk() must now send data the same length as requestedirungentoo
in the requested chunk callback. For zero size transfers if the data sent is not the same length, the file is assumed to be done.
2015-03-12Don't assume tox_file_send_chunk() is called in the request chunkirungentoo
callback.
2015-03-12Added position parameter to tox_file_send_chunk().irungentoo
This is done so that the function now has the same parameters as the request chunk callback.
2015-03-12tox_new now sets error to TOX_ERR_NEW_PORT_ALLOC when binding to port fails.irungentoo
2015-03-11tox_callback_connection_status() implemented.irungentoo
Attempted fix of connection checking to make it more stable.
2015-03-10Implementation of new api file transfers.irungentoo
Everything should work except resuming.
2015-03-09Updated new_filesender function in Messenger.cirungentoo
2015-03-06Updated File request packet to new format.irungentoo
[uint8_t packet_id (PACKET_ID_FILE_SENDREQUEST)][uint8_t file_number] [uint32_t type][uint64_t file_size][filename (currently max 255 bytes)] recv file numbers are << by 16 to distinguish them from sending files.
2015-03-05enums are no longer typedefed to uint8_t.irungentoo
2015-03-05Code cleanups.irungentoo
Fixed wrong variable used, removed useless elements of struct.
2015-03-02Merge branch 'port_range_option' of https://github.com/saneki/toxcore into ↵irungentoo
new_api