Commit Graph

495 Commits

Author SHA1 Message Date
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
Liam Stanley
a796f9b02f
event.go: fix spelling; ref #17 2018-09-04 08:58:25 -04:00
nmeum
12274e1704 Fix pretty printing of nick messages (#15) 2018-09-04 08:49:43 -04:00
nmeum
a5d4d6aada add: pretty print invite command (#13) 2018-08-17 07:58:17 -04:00
Pete
102f17f863 Fix IsValidUser() (#12)
Fails while checking the first character of name if > J.
2018-04-27 12:00:07 -04:00
Liam Stanley
e46d210b5d fix Client.conn data race during pong; closes #11 2018-04-06 21:29:34 -04:00
Liam Stanley
2e1546f204 spelling 2018-03-31 11:39:33 -04:00
Liam Stanley
c59d4cb2be update contrib ref 2018-03-03 02:55:10 -05:00
Liam Stanley
ab3d8a3000 update refs 2018-02-04 15:21:35 -05:00
Liam Stanley
ff7da4fa36 make sasl error less specific 2018-02-04 15:17:40 -05:00
Liam Stanley
a0910c7504 split out sasl and tag handling 2018-02-04 15:16:43 -05:00
Liam Stanley
9e7aa2b446 pretty print ircv3 cap list 2018-02-04 15:06:40 -05:00
Liam Stanley
e4e045f864 spelling.. 2018-01-28 16:30:54 -05:00
Liam Stanley
a9879bd725 update ref list to includ grawity/irc-docs and ircdocs.horse 2018-01-28 16:05:57 -05:00
Liam Stanley
90b702a763 add Event.Timestamp field; add IRCv3 server-time support 2018-01-27 23:42:02 -05:00
Liam Stanley
88956d2424 add draft/msgid ircv3 support 2018-01-27 22:44:44 -05:00
Liam Stanley
bf5241d4ff update message-tags cap to use recommended draft prefix 2018-01-27 22:22:05 -05:00
Liam Stanley
a9c1bd980a clean up event docs 2018-01-27 21:55:13 -05:00
Liam Stanley
5c0e57078c add Event.Echo field 2018-01-27 21:48:44 -05:00
Liam Stanley
54806847f1 add echo-message to debug output for incoming echo messages 2018-01-27 20:24:32 -05:00
Liam Stanley
507c1bc866 client method refactoring; additional tests 2018-01-27 20:02:04 -05:00
Liam Stanley
7cadb56183 add Client.HasCapability() method 2018-01-27 20:01:27 -05:00
Liam Stanley
9517b2fb8c better support for echo-message 2018-01-27 16:16:20 -05:00
Liam Stanley
4e577e7ee0 explicitly add 1.9 to travisci 2018-01-27 07:01:36 -05:00
Liam Stanley
9c368fb527 add Event.Equals method and tests 2018-01-27 07:00:17 -05:00
Liam Stanley
776255db80 add Source.Equals() method 2018-01-27 07:00:05 -05:00
Liam Stanley
92b0833444 add Tags.Equals() and Tags.Keys() methods 2018-01-27 06:58:54 -05:00
Liam Stanley
7b7d06fe3e be less restrictive for lower-valued tcp ports 2018-01-17 07:19:13 -05:00
Liam Stanley
667539cee3 clarify client -> server ping timeout error 2017-12-15 07:53:54 -05:00
Liam Stanley
5dff93b545 keep compatibility with go1.8 2017-11-30 22:41:30 -05:00
Liam Stanley
f1d316076b add Ban, Unban and Mode to Commands 2017-11-30 14:37:24 -05:00
Liam Stanley
e8273d405d improve handler execution to prioritize background handlers first 2017-11-30 14:37:00 -05:00
Liam Stanley
5888e03908 add mattermost to example list 2017-11-30 11:08:38 -05:00
Liam Stanley
67171b462e Channels->ChannelList; Users->UserList; replace with methods returning user/channel objects 2017-11-30 10:59:11 -05:00
Liam Stanley
7d8481950d add support for znc ~ channel prefixes, and ? user prefixes 2017-11-30 10:44:25 -05:00
Liam Stanley
24ad31ae04 more tests; additional documentation 2017-11-30 10:36:11 -05:00