Commit Graph

160 Commits

Author SHA1 Message Date
irungentoo
94ac524374
Group audio might work now but I have not tested anything yet. 2014-11-10 17:59:14 -05:00
irungentoo
8b35d194c0
Group chats are starting to work. 2014-09-26 13:25:52 -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
c4f0650ae3
Fixed const related warnings. 2014-07-02 16:04:41 -04:00
Tux3 / Mlkj / !Lev.uXFMLA
3044bd8101 Fix CppCheck style errors
#if 0 the content of toxav/msi.c : int stringify_message(MSIMessage
*msg, char *dest)
This function has no effect and does not seem to be used for actively
waiting.

Fix various other style errors, reduce scope when possible, avoid
redundant writes, clarify operator priorities, etc.
2014-06-20 21:43:21 +02:00
irungentoo
07936960df
Astyle and fixes. 2014-06-10 18:35:55 -04:00
irungentoo
7a11c10429
Fixed some nTox bugs. 2014-06-08 09:21:37 -04:00
liuguangzhao
9aa28c10b8 fix nTox cmdline input slow problem. 2014-06-08 14:08:52 +00: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
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
f7beb70fe9 nTox fixes.
Added TOX_MAX_MESSAGE_LENGTH to tox.h
2014-03-18 20:45:03 -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
Maxim Biro
5a142bb697 Renamed dht server to dht node 2014-02-22 17:07:15 -05:00
irungentoo
554afe11d7 Some api changes. 2014-02-21 11:38:04 -05:00
Ben Iofel
174cec7f15 proper windows preprocessor detection 2014-01-19 19:30:14 -05:00
irungentoo
a6d5a54c79 Fixed ntox building on windows. 2013-12-19 12:36:51 -05: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
eec31edb1c Fix return code inconsistency. 2013-11-29 18:26:09 +08:00
Coren[m]
26fef7cf9a
Various changes to nTox including a potential crash (also possible from remote!), and a tiny change to toxcore.
Crash stuff:

nTox.c:
- do_refresh(): avoid crashes (input a "%" and the client goes "boom!", send someone a string with embedded "%" and see him blow up...)

Other stuff:

toxcore: tox.h (doc.)/network.c (code):
- networking_wait_prepare(): return -1 if lenptr was NULL and therefore not settable

nTox.c:
- fraddr_to_str(): function to convert a TOX_FRIEND_ADDRESS into a segmented (and therefore line-breakable) string
- print_friendlist(): print index of friend on name line, print id on 2nd line
- command /f: skip spaces (and +) inside a friend id
- command /r (new): "/r #" to remove a friend
- main(): reduce cpu consumption if we're not currently sending files
2013-11-27 21:00:23 +01:00
Coren[m]
a204b95c51
Print a more detailed message on CHAT_CHANGE_PEER_DEL, so a user isn't confounded by the change of peer numbers.
On deleting the last peer, it's just a delete.
On deleting any other peer, the last peer is moved into that space, gaining a different number.
Print that detail where appropriate.
2013-11-26 18:55:11 +01: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
Coren[m]
ca621bd440
Wrapping: Expanded space of output to be a bit larger than input. Basic wrap(): Embed continuation markers if there's enough space. 2013-11-14 02:45:37 +01:00
Coren[m]
bde536f6bc
Add a "conversation mode", where you set your conversation partner once and then all non-commands are sent as message to them.
/cf # rsp. /cg # sets, /cr resets target

Also reformatted display of sent group message slightly to look less beta-ish.
Then using "#<num>" for group number vs. "<num>" for friend/peer numbers.
Also changed to a slightly different message on people without name.
2013-11-13 22:34:02 +01:00
irungentoo
244c625e51 Merge branch 'group_peername' of https://github.com/FullName/ProjectTox-Core into FullName-group_peername 2013-11-12 19:41:52 -05:00
Coren[m]
6d31a9be7e
Group chat: Add a nickname message. Remove strange default nickname. (Seriously...)
group_chats.*:
- group_send_nick() to send own name
- setnick() to store a received name

Messenger.c:
- group_send_nick() before group_sendmessage() (in regular intervals, to inform new peers)

nTox.c:
- print_groupmessage(): on error or on a name of length zero the result of tox_group_peername() isn't null-terminated, catch that
2013-11-12 19:57:01 +01:00
Coren[m]
e457eb6635
Undo faulty newlines, undo extra newlines. 2013-11-12 14:17:48 +01:00
Coren[m]
553aba0498
nTox.c:
- multiple places: tox_getname() doesn't terminate the string, make sure nTox does
- format_message():
.  - renamed to print_formatted_message()
.  - changed semantics: does the new_line() itself, saves caller from freeing the buffer (which no caller did)
.  - changed signature: now also prints the friend's name when sending
.  - intern: date is only printed once, the message line gets only time
- print_message(): enforce null termination
- main():
.  - setlocale() to init locale (for date/time printing)
.  - own name: ensure null termination

Messenger.c:
- notify of friend name change *before* the old name is overwritten
2013-11-11 15:25:54 +01:00
Coren[m]
4993928888
Started as a simple bugfix for wrap(), expanded to more detailed help.
nTox.c:
- flag[]: additional flag for special wrapping
- help expanded and split (to keep below 256 chars)
- new_lines_mark(): stores flag for special wrapping
- print_friendlist():
.  - extracted pattern for output
.  - added length of id string allocation
.  - replaced '\t' with '+ ', wrappers don't account for '\t'
- line_eval():
.  - removed a few do_refresh() directly after a new_lines() (calls do_refresh() at its end)
.  - 'h' (help): parsing of an additional character for f(riend) or g(roup)
- wrap():
.  - the major bugfix:
.    - no more endless looping if the input had a substring with no spaces
.      for more than line_width (e.g. ID of 78 and window smaller than 78)
- wrap_bars(): wrap() for "rich" messages, honors embedded '\n', breaks preferable at '|'
- print_help(): listed all options and added explanations
- print_invite(): fixed minuscule typo
- main(): made print_help() reachable again

nTox.h:
- majorly cut down to what is really needed
2013-11-10 19:06:17 +01:00
irungentoo
4aa507b664 Added function to get the piece size for sending files. 2013-10-08 18:55:35 -04:00
irungentoo
97f192969c Fixed warnings. 2013-10-05 11:24:30 -04:00
irungentoo
fbd494a8b4 File sending added to public api. 2013-10-02 20:53:24 -04:00
irungentoo
6425cf3b53 File control packets can now be used by the person sending the file. 2013-10-02 20:08:14 -04:00
irungentoo
6182af8449 nTox updated with changes in core, some file sending things fixes. 2013-10-01 18:59:33 -04:00
irungentoo
3c7de51ba5 Basic ntox file sending. 2013-09-30 13:13:49 -04:00
Coren[m]
6fe25e4f6f Permit -Wshadow as useful warning. 2013-09-27 11:24:33 +02:00
Coren[m]
330c1bee5c nTox: keep bootstrap()ping every 10 seconds, until we get a connection running (the initial one might get lost, it IS done via UDP after all)
nTox.c:
- main(): keep calling tox_bootstrap_from_address() every 10 seconds, until the connection is established
2013-09-21 02:02:27 +02:00
irungentoo
d2b9b059ba Forgot an else. 2013-09-18 11:19:32 -04:00
irungentoo
1a9ee5c95f Fixed bad code in nTox. 2013-09-18 11:11:10 -04: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
Coren[m]
ab2805a23b Fix warnings of -Wall -Wextra 2013-09-16 10:37:22 +02:00
Coren[m]
6d3ac937af Merge remote-tracking branch 'upstream/master' into nTox 2013-09-15 19:07:54 +02:00
irungentoo
dde98eb345 DHT peer finding for new friends should now be slightly faster.
Also fixed the "[i] could not send message" bug in nTox.
2013-09-14 20:38:48 -04:00