summaryrefslogtreecommitdiff
path: root/toxcore/group.c
AgeCommit message (Collapse)Author
2019-08-04fix overflow in peer nick lensudden6
2019-08-04fix missing group title length checksudden6
This fixes a buffer overflow when a malformed *.tox save file is loaded.
2019-05-19add configurable limit on number of stored frozen peerszugz (tox)
2019-02-10Expose api functions for enabling and disabling AV in AV groupszugz (tox)
A group loaded from a savefile starts with AV disabled.
2019-01-12Add some const qualifierszugz (tox)
(Implementing suggestions of sudden6)
2019-01-07Avoid sending group messages to a peer before we have its group numberzugz (tox)
2019-01-06Improve handling of peers entering and leaving conferenceszugz (tox)
* send freeze packet on quit * delete existing peers with same real_pk on adding a peer * record actual number of conference peers saved
2019-01-05Expose offline conference peers in APIzugz (tox)
2018-11-29Implement conferences savingzugz (tox)
* add global friend_connection status callback, used for group rejoining * stop leaving groups on killing tox
2018-11-23Return TOX_ERR_CONFERENCE_SEND_MESSAGE_NO_CONNECTION if we are not connected ↵zugz (tox)
to any peers
2018-10-20Make saving and loading the responsibility of Tox rather than Messengerzugz (tox)
2018-09-20Send rejoin packets on conference disconnectionzugz (tox)
We were mistakenly not making a rejoin attempt on freezing connections due to all closest connections going down. This fixes that, and tweaks the test. I've still only done tens rather than hundreds of tests, but I'm fairly confident that the conference test now consistently passes.
2018-09-05Add mechanism for recovering from disconnections in conferenceszugz
* add freezing and unfreezing of peers * add rejoin packet * revise handling of temporary invited connections * rename "peer kill" packet to "peer leave" packet * test rejoining in conference test * use custom clock in conference test
2018-08-26Update copyright to 2018.iphydf
2018-08-25fix leave callback calling in del_groupchatzugz (tox)
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-08-13Avoid passing -1 as friend connection to new groups.iphydf
Somehow it still works because the lower levels can deal with inconsistent/broken state, but this lets us avoid that broken state in the first place. If a friend connection doesn't exist, we don't add it to our group.
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-12add callback for successful connection to a conferencezugz (tox)
2018-08-11Split out conference type (text/av) from identifier.iphydf
2018-08-10Use the crypto random functions instead of `rand()`.iphydf
Presumably the uses of `rand()` were fine because they were not used in security-sensitive places, but having to think about whether a crappy RNG is acceptable in each situation requires effort that could better be spent elsewhere. Also, this means that once we have a custom deterministic RNG for testing, that RNG is used everywhere, so all the code is deterministic. It also allowed us to delete a system-specific function that wasn't used anywhere except in a call to `srand()`.
2018-08-02Fix problems with initial connections and name-setting in conferenceszugz
* test names in conference_test * raise error on attempt to invite friend to group before we are connected * revise handling of temporary invited connections We are now careful not to prematurely delete a connection to a peer established during the invitation process; namely, before we have sufficient other connections and have confirmed that we have an alternative route to the peer. * process out-of-order messages from a peer * don't reset names when handling a Peer Response
2018-07-21Reduce nesting by doing more early returns on error.iphydf
This almost entirely avoids any else-after-return in toxcore. One case is left, and that one is more readable this way. Why no else after return: https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return Why exemptions exist: https://blog.mozilla.org/nnethercote/2009/08/31/no-else-after-return-considered-harmful/
2018-07-18Use enums for group packet types.iphydf
Also moved some macros up to the beginning of `group.c`. This change brings us closer to the PGC PR.
2018-07-13Add conference_by_uid and conference_get_uid functions.iphydf
These are useful once we have persistent group chats, so clients can store data associated with this permanent group identifier.
2018-07-12Limit number of group chats to 65536.iphydf
By changing numchats from uint32_t to uint16_t. This is done in PGC. This PR is making that change in master to reduce the diff in the PGC branch. Also: * Inverted groupnumber_not_valid and renamed to is_groupnumber_valid. * Renamed realloc_groupchats to realloc_conferences and made it return bool. * Added setup_conference function that currently just zeroes the conference structure but later will initialise more values. * Made some `i` iterator variables local to the for-loop using for-init-decl. This is also done in PGC.
2018-07-12Use named function types for group callbacks.iphydf
Also some other cleanups. This PR means that future PRs, i.e. the PGC PR, must not break the rules established here.
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ```
2018-07-07Call the "peer leaves" callback only once on group delete.iphydf
We used to pass the actual peer numbers of peers leaving, but we no longer know these in the PGC world, so we don't pass them anymore.
2018-05-20Move system header includes from network.h to network.ciphydf
2018-02-27Remove deprecated conference namelist change callback.iphydf
2018-02-27Change default username to empty stringtox-user
Fixes #768
2018-02-20Make the "persistent conference" callback changes new functions.iphydf
We can now revert the changes to the callbacks and keep supporting them until clients have moved off them.
2018-02-20make groupnumber uint32_tsudden6
fixes #606
2018-02-17Send 0 as peer number in CHANGE_OCCURRED group event.iphydf
2018-02-09Adopt the "change occurred" API change from isotoxin-groupchat.iphydf
The logic and behaviour remain the same, but PEER_EXIT and PEER_JOIN are merged into LIST_CHANGED. This allows clients to take a first step to adapt to the API change without us having to actually submit the full change, yet.
2018-02-02Revert "Add correction message type"Diadlo
This reverts commit e16d3894c5979fcfe1c57bf7dadc455ce690baf9 and commit c5976e37eaadf663dc3d0c18376ea023355048f3.
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2018-01-25Remove dead return statement.iphydf
Turning this code: ```c if (cond) { ... return 0; } if (!cond) { ... return 0; } return -1; ``` into: ```c if (cond) { ... return 0; } else { ... return 0; } ``` The `return -1` in the first variant can never happen.
2018-01-16Make DHT a module-private type.iphydf
2018-01-16Make Net_Crypto a module-private type.iphydf
2018-01-15Add correction message typeDiadlo
2018-01-14Make Friend_Connections a module-private type.iphydf
2018-01-10Fix formatting in some C files.iphydf
Also replace &(x) with &x for consistency.
2018-01-06Add support for building the monolith test on android.iphydf
2017-06-04Add a monolith_test that includes all toxcore sources.iphydf
This requires that every symbol, even if static (file-scope), is unique. The idea is that we can easily run "whole" program static analysis on programs that include monolith.h ("whole" is in quotes, as we don't include dependencies like libsodium in this static analysis).
2017-02-26Add part of platform-independent network API implementationDiadlo
socket -> net_socket htons -> net_htons htonl -> net_htonl connect -> net_connect sendto -> net_sendto_ip4 getaddrinfo -> net_getipport sa_family_t -> Family
2017-01-28Add VLA compatibility macro for C89-ish compilers.iphydf
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