Commit Graph

705 Commits

Author SHA1 Message Date
Přemysl Eric Janouch e2bb051bd3
degesch: replace degesch.connect with async.dial
Halfway there, looks much saner.
2016-11-04 22:02:26 +01:00
Přemysl Eric Janouch 52d1ded7df
degesch: move the Lua async code within the file 2016-11-04 20:44:23 +01:00
Přemysl Eric Janouch cb9f187f80
degesch: get rid of Lua timer hooks
Since they were the exception and have been replaced with the async API.
2016-11-04 20:21:46 +01:00
Přemysl Eric Janouch 0247c4667a
degesch: Lua coroutine safety 2016-11-04 20:12:28 +01:00
Přemysl Eric Janouch 572f4e2ea3
degesch: implement Lua coroutine async basics 2016-11-04 20:11:59 +01:00
Přemysl Eric Janouch b24bb0aded
degesch: fix join/part hiding in the backlog 2016-10-30 16:24:23 +01:00
Přemysl Eric Janouch 6cee7159f2
degesch: clean up
Caught by Coverity, however it is quite harmless.
2016-10-29 21:08:15 +02:00
Přemysl Eric Janouch 568f9b7123
degesch: tiny fixes for the prompt hook
It should return valid UTF-8.

Also remember to refresh the prompt upon hook removal.
2016-10-29 20:03:31 +02:00
Přemysl Eric Janouch 0d499dd125
degesch: avoid senseless indirection in hooks
It's always been one function call only this far.
2016-10-29 19:51:54 +02:00
Přemysl Eric Janouch 37e49b54cf
degesch: rename things around terminal attributes 2016-10-29 18:07:28 +02:00
Přemysl Eric Janouch 742d590b8d
degesch: simplify "attribute_printer"
Now that the line wrapper took over some of the state.
2016-10-29 17:53:06 +02:00
Přemysl Eric Janouch b6528c73e3
degesch: microoptimization 2016-10-28 18:16:21 +02:00
Přemysl Eric Janouch 1e79aaec26
degesch: refresh the prompt when a hook is set 2016-10-28 13:58:37 +02:00
Přemysl Eric Janouch 0995da3900
degesch: don't consider all mode changes important 2016-10-28 13:32:29 +02:00
Přemysl Eric Janouch c8a826f016
degesch: optimize Lua weak refs 2016-10-28 13:09:50 +02:00
Přemysl Eric Janouch 557a39c6c8
degesch: export server state as a string to Lua 2016-10-28 12:47:11 +02:00
Přemysl Eric Janouch 745e758394
degesch: add Lua API for screen size retrieval 2016-10-28 04:12:06 +02:00
Přemysl Eric Janouch b60bdf119a
degesch: add a prompt hook 2016-10-28 04:12:06 +02:00
Přemysl Eric Janouch 278e2b236b
degesch: add introspection for refs within str_maps
This required some fixes to the design.
2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch 2f758bbdb9
degesch: allow lists of refs in introspection 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch 911276b263
degesch: add introspection for "app_context" 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch cb5ad675a6
degesch: add introspection for "str" and "str_map" 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch 9408dfc67c
degesch: create Lua refs through introspection 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch fed8b06aff
degesch: begin work on direct introspection 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch 7e64fd9886
degesch: cleanup 2016-10-28 04:12:05 +02:00
Přemysl Eric Janouch 6928184a3d
degesch: defer prompt refreshing
Now that we do it each time we receive a message from the server.
2016-10-23 17:34:52 +02:00
Přemysl Eric Janouch f7155f3919
degesch: allow hiding join/part messages 2016-10-23 17:14:24 +02:00
Přemysl Eric Janouch f032466307
degesch: comments, no functional change 2016-10-23 17:14:24 +02:00
Přemysl Eric Janouch c0f4b554ef
degesch: show channel user count in the status 2016-10-23 17:14:24 +02:00
Přemysl Eric Janouch 639da7a9a7
degesch: accept Word shortcuts for formatting
Because why not.
2016-10-23 13:40:04 +02:00
Přemysl Eric Janouch 230b04014f
Bump liberty, add consts to some arguments 2016-10-23 13:38:46 +02:00
Přemysl Eric Janouch 8028c7fa47
Bump liberty 2016-10-11 10:52:49 +02:00
Přemysl Eric Janouch 43de836b91
degesch: exit with error when arguments are given 2016-09-29 13:40:15 +02:00
Přemysl Eric Janouch 16d10f574b
degesch: simplify highlight detection 2016-09-25 14:11:30 +02:00
Přemysl Eric Janouch 4cefa5ab1b
degesch: fix highlight detection in colored text 2016-09-23 23:46:26 +02:00
Přemysl Eric Janouch 92a4d4b5a7
Better support for the KILL command 2016-09-23 22:50:30 +02:00
Přemysl Eric Janouch 483ab39e3c
degesch: die on configuration parse errors
Seems more sensible.
2016-07-23 20:00:40 +02:00
Přemysl Eric Janouch beaf1a1f82
degesch: fix Ctrl-J in Readline 2016-07-23 19:13:55 +02:00
Přemysl Eric Janouch d6a9e1dca1
degesch: customizable date change messages
Now also in the backlog.
2016-04-21 23:50:05 +02:00
Přemysl Eric Janouch c8e4833086
degesch: add a NOWRAP flag to formatter_flush()
--format should work as before now.

It is now also possible to rebind PageUp to show a wrapped backlog.
2016-04-21 23:50:05 +02:00
Přemysl Eric Janouch 99595c0d81
degesch: update comments 2016-04-21 23:50:05 +02:00
Přemysl Eric Janouch fa5e005728
degesch: refactor Lua weak objects 2016-04-21 22:09:35 +02:00
Přemysl Eric Janouch a9b77b3206
degesch: expose channels and users to Lua 2016-04-21 22:09:35 +02:00
Přemysl Eric Janouch 4665807d09
degesch: expose message parsing to Lua 2016-04-21 22:09:35 +02:00
Přemysl Eric Janouch 3a8d70de66 degesch: fix crash on invalid cp1252 characters
We don't even really need iconv here.
2016-04-03 04:05:04 +02:00
Přemysl Eric Janouch 8a3144f0ac degesch: update program logo
I've noticed that the old one wasn't very pleasant to look at.
2016-03-28 21:08:04 +02:00
Přemysl Eric Janouch dc71af9c31 degesch: fix two minor issues
- completely new unread markers could be created in active buffers
 - control characters confused word wrapping
2016-03-26 20:59:37 +01:00
Přemysl Eric Janouch f964495d1a degesch: don't wrap lines in pager 2016-03-26 16:41:55 +01:00
Přemysl Eric Janouch 550a0419a6 degesch: detect //TRANSLIT support, use cp1252
Now BSDs should have it enabled as well.
2016-03-26 14:27:59 +01:00
Přemysl Eric Janouch 9b12c830d1 degesch: remap goto-activity to M-a
weechat appears to use this key binding, so let's not reinvent it.
2016-03-26 13:11:28 +01:00
Přemysl Eric Janouch 1e24d1d1b8 degesch: add partial matching /buffer goto 2016-03-26 13:00:10 +01:00
Přemysl Eric Janouch 6292114c76 degesch: append message count in /buffer listing 2016-03-26 05:15:11 +01:00
Přemysl Eric Janouch e646afe5ae degesch: retain the unseen marker
Don't erase the message counts immediately.

Also make the marker visible in the pager.
2016-03-26 04:55:46 +01:00
Přemysl Eric Janouch 410bcdcd78 degesch: phase 1 of word wrapping implementation 2016-03-26 04:52:05 +01:00
Přemysl Eric Janouch 1c9de9291b degesch: cleanup, fix no-tty mode FWIW
Removed the no color mode that couldn't even be enabled.

Not sure why we still support running without a proper terminal
but let's at least not make it crash for now.
2016-03-13 16:44:06 +01:00
Přemysl Eric Janouch f96fa66168 degesch: add a --format switch 2016-03-12 14:28:17 +01:00
Přemysl Eric Janouch 42d88f87f5 degesch: add unbound commands for buffer movement 2016-03-10 00:07:59 +01:00
Přemysl Eric Janouch a1c4a1ef3a degesch: fix binding to our own fns from inputrc 2016-03-10 00:06:28 +01:00
Přemysl Eric Janouch dc248b8840 degesch: add goto activity and highlight 2016-03-08 22:29:40 +01:00
Přemysl Eric Janouch 09c7d9a65d degesch: fix mIRC color parsing 2016-03-08 01:59:51 +01:00
Přemysl Eric Janouch 0f1fd2eb3a Update NEWS, cleanup 2016-03-07 23:43:47 +01:00
Přemysl Eric Janouch 696273558e degesch: rewrite input layer
Now with less #ifdefs.
2016-03-07 22:52:56 +01:00
Přemysl Eric Janouch 584d2f0295 degesch: use libffi to unify input callbacks
And fuck you both, Readline and Editline.
2016-03-06 18:12:12 +01:00
Přemysl Eric Janouch 17804fa49b degesch: fix +=/-= to null config items 2016-03-05 19:15:40 +01:00
Přemysl Eric Janouch 6190733079 degesch: mark a problem 2016-02-29 02:50:41 +01:00
Přemysl Eric Janouch 056e0a4765 Resolve tls_ca_{file,path} relative to config dir 2016-02-19 23:46:44 +01:00
Přemysl Eric Janouch 06b03d336e degesch: fix segfault on sent messages w/o buffer 2016-02-12 04:04:35 +01:00
Přemysl Eric Janouch 11519ee860 degesch: update screen size when terminal resumed
Apparently we don't receive the events when we give up the terminal.
2016-02-10 23:02:33 +01:00
Přemysl Eric Janouch 03d5b27398 degesch: use mkstemp() with a safe umask 2016-02-09 13:52:56 +01:00
Přemysl Eric Janouch 3315b16f79 degesch: log messages from /quote and plugins
That is, parse back all output messages and log based on that.
2016-02-09 05:10:41 +01:00
Přemysl Eric Janouch 333ad2c981 degesch: allow changing the list of used CAPs
Bump liberty.
2016-02-01 21:57:43 +01:00
Přemysl Eric Janouch a850ee45f1 degesch: optimize buffer memory usage
We have approximately 5 formatter_items per buffer_line.  Let's assume
we're on a 64-bit machine.  Then there were (5 * 2) + 3 useless pointers
(104 bytes) as well as 5 * (4 + 4) = 40 bytes of wasted space because
of needless padding.  That's 144 bytes already.  Compared to that, this
change adds 16 bytes of overhead for an array sentinel, i.e. 128B less.

With a limit of 1000 lines per buffer, we've saved ~128kB per buffer
on completely useless data, and code complexity stays roughly the same.

All in all, memory usage for buffers should be about 50% lower.
2016-01-31 21:43:23 +01:00
Přemysl Eric Janouch 10a264ec3d kike: add support for IRCv3.2 server-time 2016-01-31 21:43:23 +01:00
Přemysl Eric Janouch f57664ddd0 degesch: add an assertion
It should never fail with current code.
2016-01-18 00:59:43 +01:00
Přemysl Eric Janouch 773d14e740 degesch: disable TLS compression 2016-01-18 00:45:20 +01:00
Přemysl Eric Janouch 221ae03b5c degesch: Lua: fix memory leak on load failure 2016-01-17 22:57:16 +01:00
Přemysl Eric Janouch 588a696c68 degesch: lesser heap fragmentation 2016-01-17 22:15:48 +01:00
Přemysl Eric Janouch fdeb550ee0 degesch: fix backlog limit
It was effectively infinite.
2016-01-15 22:11:05 +01:00
Přemysl Eric Janouch c4a18ec8a7 degesch: fix and simplify screen handling
Now with less madness.
2016-01-15 05:40:20 +01:00
Přemysl Eric Janouch d0db1a6cdc degesch: enforce fullscreen buffers
Probably long overdue.

Now we actually look like something resembling a regular IRC client.
2016-01-15 05:12:03 +01:00
Přemysl Eric Janouch 9333081178 degesch: option for fullscreen buffers 2016-01-15 05:09:42 +01:00
Přemysl Eric Janouch b7c9e8ca23 degesch: make backlog limit configurable 2016-01-15 05:09:42 +01:00
Přemysl Eric Janouch f39e2a4bc8 degesch: Lua: add autocomplete hooks 2016-01-15 02:39:10 +01:00
Přemysl Eric Janouch 56858a97dd degesch: Lua: allow simulating user input
Also added UTF-8 validation to buffer:log() while I'm at it.
2016-01-14 03:34:29 +01:00
Přemysl Eric Janouch 331d1842b9 Bump liberty, shuffle some code 2016-01-14 03:26:02 +01:00
Přemysl Eric Janouch 32f719dec7 degesch: Lua: pass hostname to on_connected 2016-01-09 06:19:54 +01:00
Přemysl Eric Janouch 0b92e9210c degesch: Lua: set sockets to nonblocking 2016-01-09 05:47:24 +01:00
Přemysl Eric Janouch 092e9b5101 Bump liberty 2016-01-09 05:27:45 +01:00
Přemysl Eric Janouch faa0c989f8 degesch: Lua: actually allow filtering out input 2016-01-09 05:05:46 +01:00
Přemysl Eric Janouch 53e72dd12d degesch: Lua: provide a traceback on load error 2016-01-09 05:01:50 +01:00
Přemysl Eric Janouch 83c14ba264 degesch: Lua: fix plugin configuration names 2016-01-09 05:01:50 +01:00
Přemysl Eric Janouch 64143a5957 degesch: Lua: fix luaL_ref() usage 2016-01-09 05:01:50 +01:00
Přemysl Eric Janouch aca153f575 degesch: Lua: fix configuration loading
Not the cleanest solution but it has to do for now.
2016-01-09 05:01:50 +01:00
Přemysl Eric Janouch 79f46752d4 degesch: make sure newlines are output correctly 2016-01-08 08:40:40 +01:00
Přemysl Eric Janouch 2a180ee084 degesch: Lua: finish implementation of connection 2016-01-07 22:49:53 +01:00
Přemysl Eric Janouch 6754c59890 degesch: Lua: avoid resource leak
If a connector's on_success callback fails, we need to destroy the connection.
2016-01-07 22:49:53 +01:00
Přemysl Eric Janouch 376bbea249 Factor out socket_io_try_{read,write}()
To be reused in Lua connection API.
2016-01-07 22:49:53 +01:00
Přemysl Eric Janouch a5ac0d24b8 degesch: fix handling of input editor death 2016-01-07 22:49:53 +01:00
Přemysl Eric Janouch 1d3910fd8e degesch: fix switching of buffers by command
Readline used to erase the new buffer's contents.

Defer processing.
2016-01-07 22:49:49 +01:00
Přemysl Eric Janouch a259e96405 degesch: Lua: fix a resource leak 2016-01-06 00:23:54 +01:00
Přemysl Eric Janouch a7be2bf160 degesch: refactor Lua
And fix handling of nil returns from filter callbacks.
2016-01-05 23:19:28 +01:00
Přemysl Eric Janouch e1c7b8dcaf degesch: Lua: halfplement a connector wrapper
You can't do anything reasonable with the socket now.
2016-01-05 22:12:22 +01:00
Přemysl Eric Janouch e9b39a1ef7 degesch: Lua: allow arbitrary userdata properties 2016-01-04 23:14:38 +01:00
Přemysl Eric Janouch a227060383 degesch: Lua: use references for hook callbacks
Don't associate the callback with the full userdata object,
we'll need this for something else.
2016-01-04 22:24:05 +01:00
Přemysl Eric Janouch 4832a99461 degesch: add basic autocomplete for /topic 2016-01-04 22:06:29 +01:00
Přemysl Eric Janouch aeb047260f Bump liberty, enable TLS SNI
Involves some rewrites to fit the new APIs.

SNI has been implemented Mostly just because we can, I don't think it's
widely in use and kike doesn't support this feature of the protocol either.
2016-01-04 01:12:42 +01:00
Přemysl Eric Janouch 1a73f1f1d7 degesch: fix a memory leak under libedit 2016-01-01 02:00:02 +01:00
Přemysl Eric Janouch 8564297e2a degesch: fix segfault on /quit under libedit 2015-12-31 23:42:43 +01:00
Přemysl Eric Janouch 74bed4bc02 degesch: Alt-Tab switch to the last buffer 2015-12-31 05:07:28 +01:00
Přemysl Eric Janouch 8f229f41e1 degesch: avoid fileno() after fork()
It's not guaranteed to be async-signal-safe, which may matter once
we start using threads. And it's also cleaner to just pass the FD.
2015-12-31 05:07:28 +01:00
Přemysl Eric Janouch b4d6decc06 degesch: typos 2015-12-31 03:57:09 +01:00
Přemysl Eric Janouch 04f87b7587 degesch: enable configuration in Lua plugins 2015-12-28 04:08:45 +01:00
Přemysl Eric Janouch b7dd384048 degesch: little step towards localisation
We don't use LC_MESSAGES, though, so it doesn't really matter as of now.

liberty currently isn't prepared for non-ASCII errors or filenames,
and just silently expects everything to be in the same all-compatible
encoding.  degesch further expects the encoding to be UTF-8.

All strings should ideally be converted to UTF-8 as soon as possible.
2015-12-25 21:36:56 +01:00
Přemysl Eric Janouch e101afab38 degesch: allow launching an editor for input
Useful for editing multiline text (such as making it single-line).

Some refactoring and cleanup.
2015-12-25 05:20:50 +01:00
Přemysl Eric Janouch 37e9165548 degesch: better handling of terminal suspension 2015-12-25 05:03:02 +01:00
Přemysl Eric Janouch 25bb7a978d degesch: refactoring 2015-12-25 05:02:58 +01:00
Přemysl Eric Janouch 7d531a9bbf Bump liberty 2015-12-13 22:44:27 +01:00
Přemysl Eric Janouch 1c009f394a Bump liberty 2015-12-11 03:01:25 +01:00
Přemysl Eric Janouch 620418fa3b degesch: add a test for configuration 2015-12-10 21:26:17 +01:00
Přemysl Eric Janouch 28e4bc1399 degesch: add more tests, bump liberty
The UTF-8 common prefix test discovered a bug in UTF-8 parsing.

Made $[1-9] in aliases insert nothing if there's no argument at that index.
2015-12-10 20:04:26 +01:00
Přemysl Eric Janouch 86d7b7aed5 degesch: add a unit test for message wrapping algo 2015-12-09 21:07:01 +01:00
Přemysl Eric Janouch 07201b7bdc degesch: compactify word wrapping algorithm 2015-12-08 23:24:40 +01:00
Přemysl Eric Janouch 2ae916fc1a degesch: clarify text wrapping algorithm 2015-12-08 22:11:11 +01:00
Přemysl Eric Janouch 2ba8908024 degesch: fix timer hook resource leak 2015-11-29 17:55:35 +01:00
Přemysl Eric Janouch 4a287a724e degesch: Lua: add a "server" property to buffers 2015-11-24 21:52:31 +01:00
Přemysl Eric Janouch 87e1236b30 degesch: Lua: add a "buffer" property to servers 2015-11-24 21:42:08 +01:00
Přemysl Eric Janouch e921a619b0 degesch: readline fixups
When a new buffer was created automatically (channel was joined),
we didn't bother to erase the current line buffer.
2015-11-24 03:04:14 +01:00
Přemysl Eric Janouch 25282cfe23 degesch: fix a segfault-inducing typo in hooks 2015-11-24 02:32:11 +01:00
Přemysl Eric Janouch 79140c3abc degesch: make auto-away less spammy 2015-11-23 08:33:58 +01:00
Přemysl Eric Janouch 4d11be0b85 degesch: implement auto-away 2015-11-22 23:12:18 +01:00
Přemysl Eric Janouch f69edd6606 degesch: optimize prompt changes
We used to do lots of unnecessary redisplays.
2015-11-22 17:49:27 +01:00
Přemysl Eric Janouch 385de6f4fe degesch: better terminal suspension
Don't print date changes while something else is using the terminal.
2015-11-22 16:43:21 +01:00
Přemysl Eric Janouch 0fdffa0e50 degesch: fix hook debug logs
Obviously we can receive back the same pointer with different contents.

I just didn't think of that.
2015-11-22 03:01:38 +01:00
Přemysl Eric Janouch 36c59ff375 Enable TCP_NODELAY 2015-11-22 02:12:52 +01:00
Přemysl Eric Janouch d135728424 degesch: pop() the Lua error in timer dispatch 2015-11-21 21:29:56 +01:00
Přemysl Eric Janouch 02c7c6dcd6 degesch: export timers to Lua 2015-11-21 19:48:15 +01:00
Přemysl Eric Janouch 364eb009ca degesch: hook implementation cleanup 2015-11-21 19:00:56 +01:00
Přemysl Eric Janouch d4cbc576e2 degesch: typos, cleanups 2015-11-21 19:00:56 +01:00
Přemysl Eric Janouch cd8e3d6d41 degesch: make Ctrl-L also fix window size 2015-11-21 14:09:34 +01:00
Přemysl Eric Janouch fa965a85e4 degesch: make /buffer with no arguments print list 2015-11-21 14:09:34 +01:00
Přemysl Eric Janouch 59a4c356dd degesch: export input and IRC hooks 2015-11-21 14:09:34 +01:00
Přemysl Eric Janouch c912726f49 degesch: add ability to hook IRC and user input
We're going to make this available to the Lua API soon.
2015-11-21 14:09:34 +01:00
Přemysl Eric Janouch fbfe0ba18a degesch: add a stubbed Lua plugin loader 2015-11-21 14:09:33 +01:00
Přemysl Eric Janouch 5ee210a5b7 degesch: stubplement plugins 2015-11-21 14:09:33 +01:00
Přemysl Eric Janouch 5d55d7f6de degesch: refcountify "struct {buffer,server}" 2015-11-19 19:11:35 +01:00
Přemysl Eric Janouch b952fc1f6d degesch: extend weak pointers 2015-11-18 23:03:21 +01:00
Přemysl Eric Janouch 89065e4d34 degesch: fix highlights 2015-11-17 00:06:48 +01:00
Přemysl Eric Janouch 281ef2e93e degesch: split input text at newlines
This makes pasting multiline text possible again.
2015-11-15 15:56:33 +01:00
Přemysl Eric Janouch 9b22d72fd1 Extend split_str() for multiple split chars 2015-11-15 15:56:10 +01:00
Přemysl Eric Janouch f11635ed7f degesch: better SIGTSTP handling 2015-11-15 15:36:03 +01:00