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

Fix status report for realname #1514

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Nov 30, 2023

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Fix status report for realname

Additional description (if needed):
.status shows the current content of variable realname, but should show the content of the realname used at the time eggdrop connected to the server or the last 311 it got.
Additionally max len for realname was upped from 80 to 120. Many servers had max len 50. But servers like inspircd have 128 and are configurable up to 500. I guess upping eggdrops limit from 80 to 120 doesnt hurt ;)
Additionally handing of unset realname was not consistent. if unset, 2 different defaults where used depending if unset in config file or unset through .tcl set realname "" during runtime. For the 2nd case default was /msg LamestBot hello. This PR changes both cases to default /msg <nick> hello.

Test cases demonstrating functionality (if applicable):
.tcl set realname testrealname
connect to irc server

.status
.tcl set realname ""
.status

Before:

.status
    Online as: BotA!eggdrop@Clk-8553FB0D (testrealname)
.tcl set realname ""
.status
    Online as: BotA!eggdrop@Clk-8553FB0D ()

After:

.status
    Online as: BotA!eggdrop@Clk-8553FB0D (testrealname)
.tcl set realname ""
.status
    Online as: BotA!eggdrop@Clk-8553FB0D (testrealname)

#define HANDLEN 32 /* valid values 9->NICKMAX */
#define NICKMAX 32 /* valid values HANDLEN->32 */
#define USERLEN 10
#define REALNAMELEN 120
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the 120 limit come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

god gave it to me in my sleep. like he gave it to the coder that wrote the former value of 80 down. What limit do you propose?

@vanosg
Copy link
Member

vanosg commented Dec 2, 2023

Can we simplify (and unfortunately, maybe re-write) this process and just store the realname value when the Eggdrop does a WHOIS on itself upon connect and if/when it receives the CAP setrealname? Then have .status display that variable instead of botname? I think that is cleaner overall.

Also, please don't mess with the default botnames, that is, like, history!

@michaelortmann
Copy link
Member Author

with the code in this PR, we will set variable used for .status display when WHOIS reply comes in.

ive got no idea about CAP setrealname. do you want to code the CAP stuff based in this PR? it could be added independently later also.

i didnt wanna mess with it. the problem was, it would be inconsistent, to have 2 default strings for the realname, but ive got an idea, we could leave the history as a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants