Commit Graph

198 Commits

Author SHA1 Message Date
irungentoo
f07c7d65b3
Tox is now shown as being online only when properly announced. 2014-09-21 10:12:55 -04:00
irungentoo
fcc6d43cf2
Prevent core from doing DNS requests when UDP is disabled. 2014-09-20 12:19:21 -04:00
irungentoo
cbb526e83f
Merge branch 'encrypted_data' of https://github.com/dubslow/toxcore 2014-09-13 21:29:33 -04:00
Dubslow
61bfa596b6 Add magic number, auto tests still required 2014-09-11 19:29:18 -05:00
Dubslow
7eb7e68805 compiling against nacl seems to break VANILLA_NACL... 2014-09-09 12:23:09 -05:00
Dubslow
46e03c4c2b Merge branch 'master' into encrypted_data 2014-09-09 07:53:59 -05:00
irungentoo
df7a627fde
Added custom packet functions to public tox api.
This should make it easy for people to use toxcore to power many
types of networked applications.
2014-09-05 21:31:35 -04:00
dubslow
c3e3258788 Update tox.c 2014-09-04 06:16:22 -05:00
Dubslow
f3831513e8 Merge branch 'master' into encrypted_data 2014-09-03 19:43:43 -05:00
Dubslow
34fc0be43f Added encrypted save to toxcore, if sodium is used
Note, this is untested
2014-09-03 19:41:23 -05:00
irungentoo
01203a2272
Expose the tox_add_tcp_relay() function in the public api.
Clients can use this function to make Tox connect to user specified
TCP relays.
2014-09-02 19:38:44 -04:00
Alexandre Erwin Ittner
e4f66475d8 Add support for user avatars in the core protocol
Add a protocol and the APIs to straightforwardly support user avatars
in client applications. The protocol is designed to transfer avatars
in background, between friends only, and minimize network load by
providing a lightweight avatar notification for local cache validation.
Strict safeguards are imposed to avoid damage from non-cooperative or
malicious users and to limit network usage.

The complete documentation is available in docs/Avatars.md and sample
code is available in testing/test_avatars.c.

Code and documentation are released under the GNU GPLv3 or later, as
described in the file COPYING.
2014-08-30 16:43:07 -03:00
irungentoo
ff02d5a607
Removed send withid functions from api. 2014-08-27 14:39:09 -04:00
irungentoo
740ab85c8e
onion_isconnected is the best indicator of if tox is connected. 2014-08-23 21:55:53 -04:00
irungentoo
08bdf45aa3
Removed now deprecated function. 2014-08-23 21:51:45 -04:00
irungentoo
7557b92fc9
Modified tox_bootstrap_from_address() function.
PORT IS NO LONGER PASSED IN NETWORK BYTE ORDER.

Removed useless ipv6enabled parameter.
2014-08-14 19:01:21 -04:00
irungentoo
ef78169842
Added disabling of UDP and basic SOCKS5 proxy support to public API.
tox_new() now takes a Tox_Options struct as argument.

If a NULL pointer is passed to that struct, defaults are used.
2014-08-14 18:34:20 -04:00
irungentoo
5376d40f54
tox_isconnected() now works on TCP only. 2014-08-14 15:41:10 -04:00
irungentoo
1298932deb
UDP can now be disabled.
new_messenger() now takes an options struct as an argument.
2014-08-14 15:27:34 -04:00
irungentoo
f4b10c99ff
Tox should now work on TCP only networks.
Coming soon: a function to disable UDP.
2014-08-13 20:47:56 -04:00
irungentoo
07ddbb8858
Added function to get public and private key from Tox object. 2014-07-30 10:29:46 -04:00
irungentoo
6d4fdb3597
Merge branch 'const_correctness' of https://github.com/schuetzm/ProjectTox-Core 2014-07-02 15:41:59 -04:00
Marc Schütz
53d731b4f1 Const-correctness for tox.c 2014-06-30 22:06:59 +02:00
Marc Schütz
8391417f61 Const correctness for toxcore/Messenger.c and related files 2014-06-30 21:26:50 +02:00
irungentoo
2fa8815a85
Fixed some warnings. 2014-06-10 18:51:40 -04:00
irungentoo
07936960df
Astyle and fixes. 2014-06-10 18:35:55 -04:00
Marc Schütz
99d5940140 Const correctness in various interdependent files 2014-06-10 20:54:48 +02:00
irungentoo
1bad0b5eea
Fixed TOX_MAX_MESSAGE_LENGTH define.
Removed some useless code from toxcore.

Astyled core code with new version of astyle.
2014-06-01 18:55:52 -04:00
irungentoo
89bf08287d
Renamed tox_do_run_interval to tox_do_interval.
tox_do_interval now returns a time in ms based on how much action
is going on in net_crypto.
2014-05-30 23:01:17 -04:00
irungentoo
0e814904e4
Replaced tox_wait* functions with tox_do_run_interval().
Build system fixes.
2014-05-30 13:20:36 -04:00
mannol
a1f2a18ae4 Merge upstream and other stuff 2014-05-20 00:10:40 +02:00
mannol
42b25a4d3e Yeah many calls 2014-04-27 19:21:26 +02:00
irungentoo
23f57d862d
Added functions to get/set the nospam value to the public api. 2014-04-04 15:11:54 -04:00
irungentoo
4f1e02bafa
tox_group_get_names now returns a list of name lengths along with the list of names.
TCP test now also tests pings.
2014-03-31 20:37:03 -04:00
irungentoo
d2d8965470 Fixed other api inconsistency. 2014-03-20 20:48:46 -04:00
irungentoo
2e48b31e47 Fixed an api inconsistency. 2014-03-20 20:32:37 -04:00
irungentoo
5770a0e29a Merge branch 'api-fix'
Main changes:
1. Strings no longer need to be NULL terminated.
2. tox_get_friend_id is now named tox_get_friend_number.
3. The friend request callback function is now (Tox *tox, uint8_t *,
uint8_t *, uint16_t, void *), the Tox object pointer has been added to
it.
2014-03-18 20:02:50 -04:00
irungentoo
5babb281c0 Friend request callback now contains the Tox object. 2014-03-16 13:24:39 -04:00
Jfreegman
7d1060abc2 add api function that gets the last time a friend was seen online 2014-03-16 05:08:35 -04:00
Maxim Biro
e118319467 Some tox_wait_* improvements 2014-03-07 22:40:00 -05:00
irungentoo
199f083e0a Userstatus function fixes. 2014-02-23 10:38:20 -05:00
Maxim Biro
298f832feb Fixed the size function for self status message 2014-02-22 00:26:48 -05:00
Maxim Biro
36adc48b78 Added size functions for names and status messages 2014-02-21 20:30:38 -05:00
irungentoo
554afe11d7 Some api changes. 2014-02-21 11:38:04 -05:00
Maxim Biro
046f92cf52 Removed typedefs for consistency 2014-02-20 18:16:32 -05:00
Jman012
5cd5f32576 Typing: Forgot the callback argument types. 2014-02-16 17:14:22 -08:00
Jman012
32afb6b1e4 Typing: Changed all return values to int for consistency and the -1 error. 2014-02-16 17:06:11 -08:00
Jman012
00f38c8deb Typos. 2014-02-16 16:50:57 -08:00
Jman012
d2019bbf99 Added user typing changes in core. 2014-02-16 13:33:37 -08:00
Jfreegman
e9f3477d69 added API function to get online friend count 2014-02-07 19:43:21 -05:00
irungentoo
c51b8a9eba Added function to save an encrypted version of the messenger.
Also added some tests.
2013-12-21 22:35:27 -05:00
irungentoo
15d17b0a3c Astyled the code. 2013-12-16 20:49:24 -05:00
Jfreegman
b92cdcf184 added groupchat actions 2013-12-13 20:27:25 -05:00
AZ Huang
2d841fb791 More API consistent fix. 2013-12-10 17:54:04 +08:00
irungentoo
1c45e59938 Added/updated some basic docs and cleaned up some things. 2013-12-07 19:06:41 -05:00
alexandervdm
3f2d815fab fix naming inconsistency in tox.h 2013-12-03 14:54:46 +01:00
AZ Huang
2cb7f24132 Fix typo. 2013-11-29 23:38:06 +08:00
AZ Huang
8419d3469a Fix API name consistency. 2013-11-29 23:12:07 +08:00
AZ Huang
1df2d5880d Should return 0 for tox_file_dataremaining since it returns unsigned 2013-11-29 22:26:29 +08:00
AZ Huang
eec31edb1c Fix return code inconsistency. 2013-11-29 18:26:09 +08:00
Coren[m]
e85e9dbb99
group_namelistchange(): for ui reasons, divulge the peernumber and the nature of the change (add, del, name change).
tox.*, Messenger.*, group_chats.*:
- expand interface of callback by peernumber/change

groupchats.c:
- call callback in addpeer/delpeer/setnick with peernumber and flag

nTox.c:
- print_groupchatpeers(): print as many names on a line as possible, not one peer per line
- print_groupnamelistchange(): only print the change, if possible (i.e. "new peer", "peer's new name")
- added command "/p" to print the list of peers
2013-11-24 21:12:26 +01:00
irungentoo
f21a9a7666 Added callback that tells you when the peer name list of a group chat changes. 2013-11-23 17:19:02 -05:00
irungentoo
d2b56faded Added function to get the number of peers and list of names for group chats. 2013-11-22 23:31:55 -05:00
Jman012
21e514572c Fixed a few typos. 2013-11-18 20:10:07 -08:00
Jman012
37d9728830 Added functions tox_count_chatlist and tox_copy_chatlist.
These functions are akin to the tox_count_friendlist and tox_copy_friendlist, made available on the public API.
2013-11-18 20:05:35 -08:00
irungentoo
2e75648f51 Code cleanups. 2013-10-23 14:42:39 -04:00
irungentoo
368231b4f8 Removed bad function from public API (This breaks toxic.) 2013-10-18 22:42:12 -04:00
Maxim Biro
571412f911 Added message ids to action messages 2013-10-10 22:27:51 -04:00
irungentoo
4aa507b664 Added function to get the piece size for sending files. 2013-10-08 18:55:35 -04:00
Coren[m]
24e4a70105 Oops. Didn't pass along the results from inside to outside... 2013-10-06 17:22:40 +02:00
Coren[m]
40e020b958 Merge remote-tracking branch 'upstream/master' into wait: replace void *tox with Tox *tox in tox.c (which now includes the declarations from tox.h) 2013-10-06 16:53:13 +02:00
Coren[m]
355c55f745 sendqueue_length no longer determines if we check for socket-can-write, but sendpacket() sets a timestamp if it happened
network.*:
- sendpacket(): checks result and on EAGAIN, stores time of this event
- networking_wait_prepare(): uses the time if set to check up to 500ms later for the socket to be writeable again
- networking_wait_cleanup(): clears the time if the socket was writeable
- fixed some accidental tabs

Messenger.*, tox.*:
- pass-through functions to reach networking_wait_cleanup()
- fixed some accidental tabs
2013-10-06 16:37:02 +02:00
Coren[m]
1331a32223 Broken *_wait() into *_wait_prepare() and *_wait_execute()
To allow the actual waiting to run without any locking, split it into preparing the data it uses and the execution of the wait.
The caller must provide with the buffer to store whatever data it requires to wait.
Completely eliminates any reliance on the existence of anything but that data in the actual wait routine.

Also fixed a few argument type warnings inside LOGGING.
2013-10-05 12:53:54 +02:00
irungentoo
fbd494a8b4 File sending added to public api. 2013-10-02 20:53:24 -04:00
Coren[m]
2af0d43ce8 Add tox_wait() for socket, allow tox.h include in tox.c
tox.*, Messenger.*, network.*;
- new function tox_wait() => waitMessenger() => networking_wait():
  - waits for a given amount of time for any sort of socket activity
  - mustn't change anything inside, mustn't poll or do other stuff
    - the point is to be able to call this asynchronously from a second thread
    - the outside shall follow up with an immediate tox_do() when there's socket activity

tox.*:
- allow inclusion of tox.h into tox.c, ensuring that the outside interface and the internal always match

util.c:
- squished a few warnings about questionable format strings
2013-10-02 16:38:54 +02:00
Jfreegman
c4702985a5 made setfriendname part of public api 2013-09-23 04:30:24 -04:00
irungentoo
ba169b7c21 Keep the code consistent. 2013-09-22 14:24:38 -04:00
Sebastian Stal
cb68be00b0 Change tox_get_friendlist API.
tox_get_friendlist() -> tox_copy_friendlist().
You now have to allocate your own memory to pass into tox_copy_friendlist.
To help with this, tox_count_friendlist() has been added to get the length
of the friend list.
2013-09-21 14:47:30 -07:00
irungentoo
5a83c1296c astyled everything. 2013-09-17 16:28:39 -04:00
irungentoo
dd12d464de Functions to get name of peer in group chat added.
Group message callback modified.
2013-09-16 20:59:53 -04:00
irungentoo
12d1c5199b astyled everything. 2013-09-14 12:42:17 -04:00
Coren[m]
e67a11dd04 Merge remote-tracking branch 'upstream/master' into Integration 2013-09-13 09:06:52 +02:00
irungentoo
f8b979a92a Put group chat functions in the public API.
Group chats are not complete, they seem to work very well though.

This means that the functions will change.
2013-09-12 20:29:30 -04:00
Coren[m]
591d6c70c6 network.*:
- addr_resolv(_or_parse_ip)(): added an optional parameter to return both an IPv6 and an IPv4 address if requested address family was AF_UNSPEC
- logging of unhandled packets

DHT.c:
- bootstrap_from_address(): use the additional return from addr_resolv_or_parse_ip() to bootstrap in both network types at once

Lossless_UDP_testclient.c:
- main(): adapt to signature change of addr_resolve()

Messenger.c. LAN_discovery.h:
- lost a htons(), readded
- moved LAN_DISCOVERY_INTERVAL #define into LAN_discovery.h

LAN_discovery.c:
- added IPv4-in-IPv6 local address test
2013-09-12 18:39:21 +02:00
Coren[m]
a74cfaea81 tox.h:
- #define'd tox's network port (as range)
- finally killed tox_new_ex() in favor of changing tox_new()'s signature
- renamed tox_bootstrap() to tox_bootstrap_from_ip()

network.h:
- #define'd tox's network port (as range)
- renamed SEND_NODES_EX to SEND_NODES_IPV6
- bind() loop uses #define'd port range

DHT.c:
- renamed SEND_NODES_EX to SEND_NODES_IPV6
- sending ipv6 node addresses even if can't use them ourselves

nTox.c:
- adapted to changed tox_new()
2013-09-12 15:42:03 +02:00
Coren[m]
513e37815d tox.h, DHT.h:
- tox_bootstrap_ex(), DHT_bootstrap_ex() renamed to tox_bootstrap_from_address(), DHT_bootstrap_from_address()
- (handle_)sendnodes_ex() renamed to (handle_)sendnodes_ipv6()
- only sending sendnodes_ipv6() if we're actually IPv6 enabled
- changed comments to conform better

nTox.c, Messenger_text.c, DHT_test.c, DHT_bootstrap.c:
- fallout from *_ex() to *_from_address()

DHT_bootstrap.c:
- corrected a potentially wrong info message

util.c:
- fixed logfile name: now (funcptr) => now() (number)

network.c:
- addead comment about the necessity of bind() to succeed

auto_test/messenger_test.c:
- defaulting ipv6enabled to TOX_ENABLE_IPV6_DEFAULT

LAN_discovery.c:
- slight cleanup and comments for clarity
2013-09-11 20:50:15 +02:00
Coren[m]
64ca4b5db2 tox.*, DHT.*:
- return to the caller if the string could be resolved into an IP

other/DHT_bootstrap.c, testing/*_test.c, testing/nTox.c:
- parse cmdline for --ipv4/--ipv6 switch to allow user a choice

util.h:
- proper old-style C-comment
2013-09-10 22:59:33 +02:00
Coren[m]
bcb283cf45 big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6 2013-09-10 16:36:20 +02:00
Coren[m]
b91b87f285 Merge branch 'master' into Integration 2013-09-09 21:31:11 +02:00
Coren[m]
05d7b157c6 tox.*, Messenger.*:
- initialisation: argument added to enable/disable ipv6 as socket

Messenger_test.c:
- initialisation: ipv4 hardcoded for now
- delegating IP resolution to DHT_bootstrap_ex()
2013-09-09 21:03:31 +02:00
Coren[m]
a77253c79b tox.*, DHT.*;
- second set of *_bootstrap_ex() functions to allow addresses instead of IPs

network.h:
- new message ID for sending/receiving IPv6 nodes

DHT.*:
- get_close_nodes():
  - additional parameter to select which kind of nodes: IPv4 or IPv6

- sendnodes()/handle_sendnodes():
  - the IPv4 message must remain intact even when the Node_format structure (which embeds IP_Port) is expanded
  - added Node4_format to keep the structure "alive"
  - copying in/out of wider to smaller format required in sendnodes()/handle_sendnodes()
  - switch of Node_format from Node4_format to Node46_format by define
2013-09-09 19:17:21 +02:00
Jfreegman
3853a30acf initialize name_length 2013-09-09 06:41:33 -04:00
Maxim Biro
f5bf852400 Removed friendstatus from client API 2013-09-07 16:05:16 -04:00
Jin^eLD
e092eee869 Allow to build vs nacl instead of libsodium
By default libsodium is used. Only if --enable-nacl is specified, then
nacl will be used instead of libsodium.

Pass locations of nacl headers and libraries by using the following
options:

--with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/
--with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-06 22:54:45 +03:00
Jin^eLD
b9455efd84 Function for retreiving a list of friend numbers
This should allow clients to sync the Tox friend list with their UI/etc.
lists.
2013-09-05 01:30:28 +03:00
JamoBox
61880ab938 last of the comment refactoring from toxcore 2013-09-02 17:25:28 +01:00
pete
82b8927af7 Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard. 2013-08-29 22:17:51 +01:00
jin-eld
e658892793 Rename core directory because of autoconf name clash
While doing the checks configure might generate "core" files and will
then try to remove them. Having a "core" directory generates an error
while runing the configure script.

There's no workaround but to rename the core directory.
2013-08-24 03:25:07 +03:00