summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.h
AgeCommit message (Collapse)Author
2020-05-02Add a check that we don't have any unused functions.iphydf
This check puts all of our code in a C++ anonymous namespace, which is effectively making all functions `static`. This allows the compiler to determine that a function is unused, so we can delete it.
2020-03-14Standardise on having a comma at the end of enums.iphydf
Most of our enums already have one. Some didn't. Tokstyle is going to require commas at the end of enumerator lists in enum definitions.
2020-03-14Fix up comments a bit to start being more uniform.iphydf
Tokstyle (check-cimple) will start enforcing comment formats at some point. It will not support arbitrary stuff in comments, and will parse them. The result can then be semantically analysed.
2020-03-14Use spdx license identifier instead of GPL blurb.iphydf
2020-03-08Pass packet ID to custom packet handlers.iphydf
We don't expose this to the user code, yet, because it would break the API, but this is useful for future internal code.
2018-11-29Implement conferences savingzugz (tox)
* add global friend_connection status callback, used for group rejoining * stop leaving groups on killing tox
2018-10-20Make saving and loading the responsibility of Tox rather than Messengerzugz (tox)
2018-10-11ensure save data unchanged after save and loadzugz (tox)
2018-09-16Fixed a silly boolean practice using uint8_thugbubby
2018-09-14Standardise header guards.iphydf
Using the full path including the repo name.
2018-09-07Add messenger state plugin system.iphydf
This is for modules like groups to hook into to have their own state management in the `tox_savedata` format.
2018-08-26Update copyright to 2018.iphydf
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-08-12Make `conferences_object` properly typed.iphydf
The void pointer here only adds opportunity to introduce bugs and doesn't actually make things more layered. It's just the code lying about being layered while it's actually spaghetti.
2018-08-04Remove unused `m_callback_log` function.iphydf
The logger callback can only be set once at the beginning, because it requires user data coming from `Tox_Options`.
2018-08-04Make a separate `struct Tox` containing the Messenger.iphydf
This allows Tox to contain additional data on top of Messenger, making Messenger not necessarily the most top-level object. E.g. groups are built on Messenger and currently awkwardly void-pointered into it to pretend there is no cyclic dependency.
2018-07-21Synchronise parameter names in headers with those in the implementation.iphydf
2018-07-19Collect `PACKET_ID*` constants in `net_crypto.h`, cleanup their usesJan Malakhovski
2018-07-12Fix style in some header files.iphydf
* Enums must by typedef'd. * Comments at end of `#define` must be `//` comments. * Typedef structs must not be anonymous. * `;` at the end of a `#define` is invalid. * Callback typedefs must list their parameter names. * No nested structs. * No inline use of function pointer types. Only typedef'd callback types are allowed. * Enum types are spelled in Camelsnake_Case. * The argument to `#error` must be a string literal.
2018-07-05Make tox.c unambiguously parseable.iphydf
Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum
2018-02-24Fix a bunch of compiler warnings and remove suppressions.iphydf
2018-02-17Make outgoing Filetransfers round-robin.zoff99
Instead of 1 FT blocking all others.
2018-02-02Revert "Add correction message type"Diadlo
This reverts commit e16d3894c5979fcfe1c57bf7dadc455ce690baf9 and commit c5976e37eaadf663dc3d0c18376ea023355048f3.
2018-01-22Use <stdlib.h> for alloca on FreeBSD.iphydf
https://www.freebsd.org/cgi/man.cgi?alloca If stdlib.h does not define alloca, and we're using GCC (or Clang), we define the macro ourselves in terms of a GCC builtin.
2018-01-15Add correction message typeDiadlo
2018-01-14Make Friend_Requests a module-private type.iphydf
2017-04-22Revert "initial version of tox_loop"Maxim Biro
This reverts commit 200ee1cace2f17537e6982ac447ea65d7c7a00b3.
2017-04-22Revert "Implement tox_loop"Maxim Biro
This reverts commit 5ff099763b1f56414572e1c12eb2f003117db5a0.
2017-04-01Implement tox_loopAnsa89
2017-04-01initial version of tox_loopmichael bishop
2017-01-21reduce thread-unsafe use of static variableszugz
- rework ip_ntoa() to avoid use of static variables - rework sort_client_list() to avoid use of static variables - move static 'lastdump' into Messenger struct - rework ID2String() to avoid use of static variables; rename to id_to_string() - fetch_broadcast_info(): attempt to mitigate risks from concurrent execution - current_time_monotonic(): attempt to mitigate risks from concurrent execution - comment on non-thread-safety of unix_time_update
2017-01-19Update license headers and remove redundant file name comment.iphydf
"All rights reserved" was incorrect. The project was licensed under GPL3, which means a lot of rights are licensed to everybody in the world, i.e. not reserved to the "Tox Project".
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)