-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding specific ip to irc connection #141
base: master
Are you sure you want to change the base?
Conversation
Add ip bind function (var myhost)
Added host bind option for irc connection, var myhost
"crypto/tls" | ||
"log" | ||
"os" | ||
|
||
irc "github.com/kofany/go-ircevent" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix is not required.
"crypto/tls" | ||
"fmt" | ||
|
||
irc "github.com/kofany/go-ircevent" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix is not required.
@@ -1,6 +1,6 @@ | |||
module github.com/thoj/go-ircevent | |||
module github.com/kofany/go-ircevent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change the module name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change as I use fork in my project
irc.go
Outdated
|
||
return nil | ||
} | ||
|
||
// Create a connection with the (publicly visible) nickname and username. | ||
// The nickname is later used to address the user. Returns nil if nick | ||
// or user are empty. | ||
func IRC(nick, user string) *Connection { | ||
func IRC(nick, user string, myhost string) *Connection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I add this functionality for my own project and im not pro in go, I try to find a better solution for this future.
Maybe you can suggest the way?
irc_callback.go
Outdated
if irc.nickcurrent == "" { | ||
irc.nickcurrent = irc.nick | ||
} | ||
if len(irc.nickcurrent) > 8 { | ||
irc.nickcurrent = "_" + irc.nickcurrent | ||
} else { | ||
irc.nickcurrent = irc.nickcurrent + "_" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would create a function for this, the exact same code is used four times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to do that in my next code update for this fork.
irc_callback.go
Outdated
irc.Lock() | ||
defer irc.Unlock() | ||
if !irc.fully_connected { | ||
// Zachowaj obecny nick i nie podejmuj kolejnej próby zmiany |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
english
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be fixed also, like I said before go is new for me (working with git pull/push also :P)
fully_connected to fullyConnected name change Co-authored-by: Iceflower <[email protected]>
myhost to host name change Co-authored-by: Iceflower <[email protected]>
Nów it should be backward compatible as of tag/release v0.1.4 of my fork |
No description provided.