4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 21:54:06 +00:00

Update vendor

* go-telegram-bot-api/telegram-bot-api
* lrstanley/girc
* matterbridge/gomatrix
This commit is contained in:
Wim
2019-01-03 00:07:50 +01:00
parent c585d00f16
commit d2044c647b
18 changed files with 310 additions and 72 deletions

View File

@ -81,6 +81,10 @@ type Config struct {
// supported. Capability tracking must be enabled for this to work, as
// this requires IRCv3 CAP handling.
SASL SASLMech
// WebIRC allows forwarding source user hostname/ip information to the server
// (if supported by the server) to ensure the source machine doesn't show as
// the source. See the WebIRC type for more information.
WebIRC WebIRC
// Bind is used to bind to a specific host or ip during the dial process
// when connecting to the server. This can be a hostname, however it must
// resolve to an IPv4/IPv6 address bindable on your system. Otherwise,
@ -154,6 +158,39 @@ type Config struct {
HandleNickCollide func(oldNick string) (newNick string)
}
// WebIRC is useful when a user connects through an indirect method, such web
// clients, the indirect client sends its own IP address instead of sending the
// user's IP address unless WebIRC is implemented by both the client and the
// server.
//
// Client expectations:
// - Perform any proxy resolution.
// - Check the reverse DNS and forward DNS match.
// - Check the IP against suitable access controls (ipaccess, dnsbl, etc).
//
// More information:
// - https://ircv3.net/specs/extensions/webirc.html
// - https://kiwiirc.com/docs/webirc
type WebIRC struct {
// Password that authenticates the WEBIRC command from this client.
Password string
// Gateway or client type requesting spoof (cgiirc defaults to cgiirc, as an
// example).
Gateway string
// Hostname of user.
Hostname string
// Address either in IPv4 dotted quad notation (e.g. 192.0.0.2) or IPv6
// notation (e.g. 1234:5678:9abc::def). IPv4-in-IPv6 addresses
// (e.g. ::ffff:192.0.0.2) should not be sent.
Address string
}
// Params returns the arguments for the WEBIRC command that can be passed to the
// server.
func (w WebIRC) Params() []string {
return []string{w.Password, w.Gateway, w.Hostname, w.Address}
}
// ErrInvalidConfig is returned when the configuration passed to the client
// is invalid.
type ErrInvalidConfig struct {
@ -273,7 +310,7 @@ func (c *Client) TLSConnectionState() (*tls.ConnectionState, error) {
// the connection to the server wasn't made with TLS.
var ErrConnNotTLS = errors.New("underlying connection is not tls")
// Close closes the network connection to the server, and sends a STOPPED
// Close closes the network connection to the server, and sends a CLOSED
// event. This should cause Connect() to return with nil. This should be
// safe to call multiple times. See Connect()'s documentation on how
// handlers and goroutines are handled when disconnected from the server.
@ -436,6 +473,12 @@ func (c *Client) GetNick() string {
return c.state.nick
}
// GetID returns an RFC1459 compliant version of the current nickname. Panics
// if tracking is disabled.
func (c *Client) GetID() string {
return ToRFC1459(c.GetNick())
}
// GetIdent returns the current ident of the active connection. Panics if
// tracking is disabled. May be empty, as this is obtained from when we join
// a channel, as there is no other more efficient method to return this info.