Commit Graph

530 Commits

Author SHA1 Message Date
c46e976ff3 Fix: blank source panic 2021-10-09 06:54:41 -07:00
9724515d2b Fix: event parsing bug 2021-10-09 06:37:51 -07:00
b84d822ec5 Fix: go module and event bug 2021-10-09 06:25:17 -07:00
c4ff5a6022 Update: README.md 2021-10-09 02:51:27 -07:00
6ef31ffdcb Update: README.md 2021-10-09 02:45:04 -07:00
606b5a452c I'm slightly drunk and I don't know what I'm doing. 2021-10-08 00:30:04 -07:00
e50801a78e Update README.md 2021-10-05 05:49:19 -07:00
9065b0d6ab New: store data bout the connected IRC server 2021-10-03 15:28:29 -07:00
1556e364c0 I'll need to rewrite tests later. Safety last. 2021-10-03 05:19:12 -07:00
59d0b7398e fix go-mod path 2021-10-03 05:16:21 -07:00
4c1d73dcbd add util.go 2021-10-03 05:06:48 -07:00
01ce96b07a Ever cook bacon on your CPU cooler? 2021-10-01 06:15:34 -07:00
Liam Stanley
771323f162 colon should only cause prefix if the param starts with a colon 2021-06-11 17:32:46 -04:00
Liam Stanley
4219526e1d mirror ContainsAny for Len() check as well 2021-06-11 17:16:42 -04:00
Liam Stanley
f97c533ce1 add addl tests 2021-06-11 17:16:26 -04:00
Liam Stanley
b7e90b27e4 Merge branch 'master' into msg-with-colon-but-no-space 2021-06-11 16:47:58 -04:00
nmeum
28ef073485
Fix conversion errors (#46) 2021-06-11 15:56:21 -04:00
Sören Tempel
8929b1a531 event: Fix serialization of messages with colon but no space
For messages that contain either a colon **or** a space character, a
messagePrefix needs to be added to the serialized messages. Previously,
a message prefix was only added for messages containing a space
character. This causes messages which only contain a colon, but not a
space to be serialized incorrectly.

For example, prior to this commit a command like `PRIVMSG #foo ::)`,
which should send the message `:)` to the channel `#foo`, was
serialized as `PRIVMSG #foo :)` which only causes a `)` character to be
sent to the channel `#foo`.
2021-06-04 21:30:28 +02:00
nmeum
2cb73c3772
event: Fix PRIVMSG/NOTICE format string (#45)
Fixes a minor typo introduced in #44.
2020-12-30 05:53:53 -05:00
nmeum
288d953b28
event: Use different source format for PRIVMSG and NOTICE (#44)
This allows distinguishing the two commands in the output of the
Pretty() function. This is useful for IRC client which use the output of
the Pretty() function for formating IRC messages.
2020-12-29 19:19:53 -05:00
Liam Stanley
4fc93959e1 update to latest supported go.mod format 2019-07-31 23:55:59 -04:00
Liam Stanley
812b7950e0 better handling of tag+verb messages without a source; handle some invalid extraneous space events from servers like unreal; additional (basic) event tests 2019-07-31 23:44:43 -04:00
Liam Stanley
05b8be7a4b provide direct quit reason support (closes #16) 2019-07-29 20:44:50 -04:00
Liam Stanley
8adc1b3054 better checks before ratelimiting; drop events if disconnected (closes #14) 2019-07-29 19:35:12 -04:00
Liam Stanley
f98113f16d use runtime.CallersFrames over Caller for panic recovery info; closes #29 2019-07-29 18:23:09 -04:00
Liam Stanley
33f2d454a5 bugfix: wrap ipv6 addresses in Client.Server() to prevent improper
escaping of colons

commit a2ddeff515d14fd010bd3d705ea6af3d3c791869
Merge: 634e679 6a0f21c
Author: Liam Stanley <me@liamstanley.io>
Date:   Sat Jul 27 00:51:17 2019 -0400

    fix merge conflicts

commit 6a0f21c9750705ed9aff2bd398640dc1f8b3e6b0
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date:   Sun Jul 21 21:18:23 2019 +0200

    use JoinHostPort() in client.Server()

    This fixes a bug where girc would fail to connect if the server was
    specified as an IPv6 address since appending a colon is not enough in
    that case.
2019-07-27 00:56:07 -04:00
Liam Stanley
634e679a3d initial sts functionality 2019-07-11 23:36:29 -04:00
Liam Stanley
b8ad83b1fb re-add draft versions of message-tags and msgid for backwards compatibility 2019-07-04 15:53:02 -04:00
Liam Stanley
f62ce57a2f add the ability to force debug logs with GIRC_DEBUG 2019-07-04 15:05:28 -04:00
Liam Stanley
e71da9d979 update to non-draft msgid spec 2019-07-04 14:43:53 -04:00
Liam Stanley
0c617b31b8 update to non-draft message-tags spec 2019-07-04 14:40:45 -04:00
Liam Stanley
51b8e096d3
move away from Event.Trailing
* initial work towards moving away from Event.Trailing

* Event.Trailing() -> Event.Last()

* fix incorrect go.mod/go.sum files

* fixes for pretty printed topics and CTCPs

* remove unneeded whitespace check

* clarify potential contents of Event.Params

* better splitting of hopcount from realname
2019-02-10 16:20:25 -05:00
Liam Stanley
c1e59a02f4 add WebIRC support; closes #33 and #34 2019-01-02 10:33:29 -05:00
nmeum
a39e11bebb remove use of unneeded rfc1459 conversion (#31)
The lookupUser function already converts the argument to an RFC 1459
compliant nick and there is no need to convert it twice.
2018-12-24 08:32:43 -08:00
Liam Stanley
14ace7725c fix comment 2018-12-14 20:27:26 -08:00
nmeum
514d004b74 client: Add GetID() function (#28)
Makes it a bit less verbose to check if an event originated from once
own client. While at it the existing code was modified accordingly.
2018-12-10 12:08:53 -08:00
nmeum
ec512cad4f Preliminary support for the MONITOR command (#22)
This commit adds support for the IRCv3.2 MONITOR command [1]. This
includes a new function for sending MONITOR commands to the IRC server
and constants for creating handlers for the server responses.

Discussion: Currently no fancy abstraction is offered for the MONITOR
command. Meaning the caller can:

1. Send MONITOR commands to the server with invalid modifier, where
   `modifier ∉ {+, -, C, L, S}`.
2. Add a target to the list of targets being monitored which is already
   in that list. Which the client MUST NOT do according to the
   specification.

Both 1. and 2. could be addressed by implementing separate functions for
the different MONITOR command modifiers (e.g. `MonitorAdd()`,
`MonitorDel()`, …). If 2. is not considered an issue and should be
resolved by the caller 1. could alternatively by defining a new type for
the modifier.

An entirely different solution would be adding methods for monitoring to
the `User struct`. For example: `User.Monitor(), User.Unmonitor(), …`.

[1]: https://ircv3.net/specs/core/monitor-3.2.html
2018-12-10 08:49:51 -08:00
Liam Stanley
618b32529b STOPPED -> CLOSED; re-add DISCONNECTED (fixes #26) 2018-12-09 17:01:19 -08:00
Liam Stanley
16faee0ef1 Merge branch 'fix23-source-id'
fixes #23
2018-12-09 16:25:34 -08:00
Liam Stanley
d173036cbc convert ID field to ID method 2018-12-09 16:23:41 -08:00
Cyrus Lopez
3aee8c2495 Fix IRC color code bug (#24)
* Fix IRC color bug preventing some color codes (e.g cyan) from formatting properly.

* Added a few color test cases to TestFormat.
2018-11-14 12:12:14 -05:00
Liam Stanley
3167511d81 initial fixes for #23 2018-11-13 22:02:34 -08:00
Liam Stanley
2816e42bbf add go.mod file 2018-11-13 21:56:45 -08:00
nmeum
3a1cc735c7 Handle NOTICEs in isFromChannel and isFromUser (#21) 2018-11-02 12:24:37 -04:00
Liam Stanley
5a5805298c update .travis.yml with new golint path 2018-10-24 15:26:35 -07:00
Liam Stanley
3ed14e1a7d remove no longer needed test case post #20 2018-09-30 23:21:37 -04:00
Liam Stanley
bbccf004ba add: expose CTCP encode/decode; add: Event.IsCTCP()
closes #20
2018-09-30 19:28:09 -04:00
Liam Stanley
0fb5b68405 fix: don't check if the CAP LS command has args (inspircd) 2018-09-13 18:10:00 -04:00
Liam Stanley
feda9ca6b3 docs: rename reference to Client.Latency() 2018-09-09 15:28:18 -04:00
Liam Stanley
b102affd93 Event.Pretty(): fill in reason even if none is given 2018-09-05 20:22:44 -04:00