Serenity Operating System
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

IRCClient: Set nick and userinfo to OS username when not set in config

authored by

Brendan Coles and committed by
Andreas Kling
d95362d8 c06a6c67

+5 -3
+5 -3
Applications/IRCClient/IRCClient.cpp
··· 39 39 #include <netinet/in.h> 40 40 #include <stdio.h> 41 41 #include <sys/socket.h> 42 + #include <pwd.h> 42 43 #include <time.h> 43 44 #include <unistd.h> 44 45 ··· 71 72 , m_log(IRCLogBuffer::create()) 72 73 , m_config(Core::ConfigFile::get_for_app("IRCClient")) 73 74 { 75 + struct passwd* user_pw = getpwuid(getuid()); 74 76 m_socket = Core::TCPSocket::construct(this); 75 - m_nickname = m_config->read_entry("User", "Nickname", "seren1ty"); 77 + m_nickname = m_config->read_entry("User", "Nickname", String::format("%s_seren1ty", user_pw->pw_name)); 76 78 m_hostname = m_config->read_entry("Connection", "Server", ""); 77 79 m_port = m_config->read_num_entry("Connection", "Port", 6667); 78 80 m_ctcp_version_reply = m_config->read_entry("CTCP", "VersionReply", "IRC Client [x86] / Serenity OS"); 79 - m_ctcp_userinfo_reply = m_config->read_entry("CTCP", "UserInfoReply", "anon"); 80 - m_ctcp_finger_reply = m_config->read_entry("CTCP", "FingerReply", "anon"); 81 + m_ctcp_userinfo_reply = m_config->read_entry("CTCP", "UserInfoReply", user_pw->pw_name); 82 + m_ctcp_finger_reply = m_config->read_entry("CTCP", "FingerReply", user_pw->pw_name); 81 83 } 82 84 83 85 IRCClient::~IRCClient()