Commit Graph

824 Commits

Author SHA1 Message Date
Alexey Sokolov
a8d2df3852 Add PutIRC(CMessage) and PutIRCRaw()
Close #1193
2018-03-11 16:44:49 +00:00
Alexey Sokolov
8da45322f0 Fix CClient::PutClient comment, add CClient::PutClientRaw 2018-03-11 15:54:20 +00:00
Alexey Sokolov
15ccaca41a Stop buffering and echoing CTCP requests and responses to other clients, except for /me
Fix interaction between self-message and CTCP:
CTCP request from client A gets reflected from ZNC to client B, because
B has self-message. B sees this as a usual CTCP request (from the same
nick), and replies (to the same nick). ZNC reflects that response to A
because A has self-message, and also passes that response to IRC server,
which sends that response back to ZNC, which sends it to its both clients.

Close #1488
2018-02-18 23:04:14 +00:00
Alexey Sokolov
658a6e6f90 Lie to modules less: make OnUserRaw strings raw 2018-02-18 22:14:18 +00:00
Alexey Sokolov
5cb50eccd1 Save channel key on user JOIN even if user was not on the channel yet,
which is the usual case.

Fix #1223
2018-02-14 08:30:21 +00:00
Alexey Sokolov
eccf5911ae Fill Message.GetChan() in user-originated module callbacks if the channel exists.
Close #1402
2018-02-11 15:13:11 +00:00
Alexey Sokolov
008170b153 Merge branch 'master' of github.com:znc/znc 2018-02-10 15:58:20 +00:00
Alexey Sokolov
a2470b3dd3 Make chan modes and permissions to be char instead of unsigned char.
Deprecate old module hooks which accept mode as unsigned char.

SWIG handles unsigned char as int, but char as a string.
Before this commit, usage of HasPerm from perl modules required this:
either $chan->HasPerm(ord('@')) or $chan->HasPerm(ord($ZNC::CChan::Op)).
Now ord() is not necessary, and these calls work too:
$chan->HasPerm('@') and $chan->HasPerm($ZNC::CChan::Op).

Fix #1486
2018-02-10 15:55:55 +00:00
Andy Fiddaman
6362844853 Stop creating files with odd permissions.
bits are being set in file mode rather than open flags. As a result file permissions get strange bits set.

```
build# ls -l /etc/opt/znc/znc.conf
-rwS------   1 znc      znc        1.62K Feb  9 14:47 /var/opt/ooce/znc/configs/znc.conf
build# stat -c %a /etc/opt/znc/znc.conf
4600
```
2018-02-09 22:25:06 +00:00
ZNC-Jenkins
fcc710b4b8 Update translations from Crowdin 2018-01-19 19:39:46 +00:00
Falk Seidel
d647eaabc0 Welcome to 2018
The same procedure as last year, Miss Sophie?
The same procedure as every year, James.

[skip ci]
2018-01-19 19:38:58 +00:00
Fox Wilson
42939c998f Add "AuthOnlyViaModule" global/user setting
Setting AuthOnlyViaModule on a user causes CheckPass to never return true,
causing all authentication attempts using the configured password to fail, both
on IRC connections and for webadmin. This is useful in situations where an
external module (cyrusauth, certauth, imapauth) handles authentication. Setting
the global AuthOnlyViaModule option causes similar behavior across every
user. If AuthOnlyViaModule is set to true globally, it cannot be overridden
per-user.

Close #1474
Close #331
2017-12-22 14:23:17 +00:00
ZNC-Jenkins
58ae4517cb Update translations from Crowdin 2017-12-21 09:14:07 +00:00
Alexey Sokolov
5904d3e38b Merge pull request #1472 from GLolol/notice-failed-logins
src/Client: send failed logins to NOTICE instead of PRIVMSG
2017-12-17 02:28:52 +00:00
ZNC-Jenkins
9dbe7bb859 Update translations from Crowdin 2017-12-15 01:23:44 +00:00
James Lu
f5fc51a63b src/Client: send failed logins to NOTICE instead of PRIVMSG
When connecting to many ZNC networks at once, one failed login causes numerous query windows from *status to pop up. These can be annoying to close depending on the client.
2017-12-13 20:21:21 -05:00
Alexey Sokolov
fd83bb3473 Merge branch 'master' of github.com:znc/znc 2017-12-13 08:30:27 +00:00
Alexey Sokolov
3b3a0ac291 Export CMake target more cleanly.
This allows external modules to use newer C++ versions than C++11.
2017-12-13 00:21:59 +00:00
Alexey Sokolov
bd51ebcdca Merge pull request #1455 from CyberShadow/timeval
Add sub-second precision for timestamp formatting
2017-12-10 11:46:22 +00:00
Alexey Sokolov
9bb8387745 Revert "Avoid calling OnWho on every channel in the network WHO was called in. (#1461)"
This reverts commit 5132ea987e.

Add a comment to explain the old behavior, by courtesy of @psychon
2017-12-10 09:53:00 +00:00
Vladimir Panteleev
15b1f8d8fa Change format syntax to a simple custom %f/%#f scheme 2017-12-10 09:45:58 +00:00
weabot
5132ea987e Avoid calling OnWho on every channel in the network WHO was called in. (#1461) 2017-12-02 23:31:04 +00:00
Alexey Sokolov
42a96cf375 Update .pot files 2017-11-13 23:35:36 +00:00
Alexey Sokolov
744bd7d55c Fix use-after-free in znc --makepem
X509_get_subject_name() returns an internal pointer, which was destroyed
by X509_set_subject_name(), and then accessed again in
X509_set_issuer_name().
But X509_set_subject_name() isn't needed at all, because subject name
was modified in place.
2017-11-12 16:45:23 +00:00
Vladimir Panteleev
03c4c0b165 Use and propagate microsecond-precision timestamps to FormatTime
This enables sub-second precision timestamp formatting for logs and
clients without server-time.
2017-10-26 00:00:51 +00:00
Vladimir Panteleev
901a21e91b Utils: Add FormatTime overload taking timeval
This overload also supports additional format sequences for formatting
the sub-second part of timeval.
2017-10-26 00:00:50 +00:00
Adam Williams
dca012f0b7 Use SameSite=strict cookies consistently (#1450) 2017-10-20 15:31:46 +01:00
Alexey Sokolov
3ba8b0cce3 Stop mixing up ./configure --enable-debug with znc --debug
Close #1449
See #1446
2017-10-15 18:00:33 +01:00
Alexey Sokolov
2ebd358521 Merge pull request #1446 from Zarthus/feature/debug-mode-awareness
transparency: Make the user aware that DEBUG mode is enabled.
2017-10-04 19:09:09 -07:00
Alexey Sokolov
57ad5cd814 Merge pull request #1445 from Zarthus/fix/debug-shows-pass
debugging: Add Filter method to hide filter sensitive data
2017-10-04 19:06:50 -07:00
Alexey Sokolov
023e57485b Revert "Remove several more "size - 1", none of which are dangereous."
This reverts commit bcabf9b55c.

I should test code better...
2017-10-04 04:41:50 +01:00
Alexey Sokolov
bcabf9b55c Remove several more "size - 1", none of which are dangereous. 2017-10-03 15:23:09 +01:00
Alexey Sokolov
d73a4090c8 Fix crash caused by an unsigned overflow.
Thanks to Joseph Bisch for discovery.
This was an artifact of converting ZNC to use CMessage. Released
versions are not affected.
2017-10-03 15:21:56 +01:00
Jos Ahrens
ab501767a1 transperancy: Make the user aware that DEBUG mode is enabled. 2017-10-02 14:46:00 +02:00
Jos Ahrens
f006e31fed debugging: Add Filter method to hide filter sensitive data 2017-10-02 14:09:45 +02:00
Alexey Sokolov
a719ea36aa Make disconkick a module again.
While not kicking upon disconnect can cause desync with client and other
issues, there were multiple complains about the new behavior, and the
user should have the choice.

Revert 2f65dbbc64
Ref #968
2017-08-26 22:18:53 +01:00
Alexey Sokolov
f885699d1a Make list of languages installed discoverable at runtime.
Stop hardcoding Russian in webadmin.
Limit the setting in controlpanel to the known languages, because
untrusted language code might lead to some interesting vulnerabilities.
2017-08-19 18:09:12 +01:00
Alexey Sokolov
328461faf1 Use IETF language tags for configuring language 2017-08-07 23:04:21 +01:00
Alexey Sokolov
0ce6b7c8ba Fix a warning
Reported by s7r
2017-06-26 00:28:57 +01:00
Alexey Sokolov
46c5b2884e Don't send PART to client which sent QUIT
Reported by milky
2017-06-20 21:58:37 +01:00
Rubin
96c92ef8ca Change default flood rates to match RFC1459, prevent excess flood problems
I noticed that the default network flood rates are wrong (for most
networks). It has been very standard since the beginning of IRC to use a
value of 2 seconds per line, with a 10 line head start. Almost all
networks work this way, and if you don't follow, having a lot of
channels or a lot of clients connected to ZNC results in excess flood
disconnections and much frustration for the user.

I think you should make the default value for these 2 and 9 instead of 1
and 4 so that this nasty bug doesn't hit people who will not know how to
debug it. You find these same types of settings built into every IRC
client. 2 and 10 is the standard. 2 and 9 provides a slight buffer so
there is no mistake.

Thanks
-Rubin

Close #1416
2017-06-01 08:22:21 +01:00
Alexey Sokolov
10bfece38c Switch znc.in URLs to https 2017-05-30 22:32:01 +01:00
Fusl Dash
2e90c9ae9e Update link to Configuration wiki page 2017-05-14 08:51:48 +01:00
Eli Young
6d0ec644d0 Support custom message tags
This provides a way for modules to register message tags and updates the
core to send tags to clients if the relevant capabilities are enabled.
2017-05-08 18:01:46 -07:00
Eli Young
823ac07240 Add OnSendToIRCMessage and OnSendToClientMessage
This also alters PutClient such that the CMessage variant handles
sending messages, rather than the CString variant. As a side bonus, this
gives callers better information on whether the message was sent to the
client. Additionally, it eliminates the need for a hook to let modules
set the tags sent to a client, as that can now be done inside
OnSendToClientMessage.
2017-04-18 15:43:16 -07:00
Eli Young
20b635aad7 Don't try to quit multiple times (#1392)
Calls to CIRCSock::Quit() eventually result in the object's destructor
being called, which itself calls CIRCSock::Quit() again. Avoid sending
multiple quit messages to the remote server by checking if the
underlying socket is already marked for closing.
2017-04-10 00:10:00 +01:00
Phansa
3189ce7f8a Welcome to 2017
Welcome to 2017

temp

temp2
2017-03-12 20:34:26 -04:00
Alexey Sokolov
6ddede7779 Revert 3382543917 and
00ddcd302f

ListChans for now will behave as before, and ShowChan isn't currently
needed.

See #914
2017-02-24 23:49:18 +00:00
Alexey Sokolov
a44aa0c699 Revert tables to how they were in 1.4
See #914
2017-02-24 23:49:18 +00:00
Jos Ahrens
14e68299fe cli: help: sort arguments alphabetically (#1367)
Changes the output of `znc --help` to order the arguments
in alphabetical order.
2017-01-21 15:36:12 +00:00