Commit Graph

198 Commits

Author SHA1 Message Date
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