Skip to content
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

過多的底線超出irc server的nick長度上限,導致暱稱碰撞 #21

Open
mmis1000 opened this issue Dec 22, 2014 · 3 comments
Open
Labels

Comments

@mmis1000
Copy link

f517e93a6a
如圖所示
freenode的nick上限為16個字
超出16個字的都無效
所以bot斷線後自動加的底線會被無視掉
導致跟原本nick碰撞
而引起登入失敗,漏掉訊息

或許可以加一個長度上限設定
在字數滿的時候
從無底線重頭開始開始loop?
e.g. ysitdlogbot_____ -> ysitdlogbot -> ysitdlogbot_

@godfat
Copy link
Member

godfat commented Dec 22, 2014

這段是 cinch 在處理的,可能要 patch 那邊..
https://github.com/cinchrb/cinch/blob/v2.1.0/lib/cinch/bot.rb#L441-L472
https://github.com/cinchrb/cinch/blob/v2.1.0/lib/cinch/irc.rb#L847-L850
暫時的解法是,設定那邊預先給很多可能的名字:

conf.nicks = (0..100).map{ |i| "ysitdlogbot_#{i}" }

這樣他會先試 ysitdlogbot_0, 然後 ysitdlogbot_1,
...直到找到可以用的名字,或是到 _99 都還找不到...

@dannvix
Copy link
Member

dannvix commented Dec 22, 2014

@godfat 👍

@dannvix
Copy link
Member

dannvix commented Dec 22, 2014

如果要像 @mmis1000 敘述那樣「循環」的話,就必須在 Logbot 裡對 cinch 做髒髒的 monkey patch 了

@godfat godfat added the bug label Dec 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants