summaryrefslogtreecommitdiff
path: root/Applications/IRCClient/IRCClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Applications/IRCClient/IRCClient.cpp')
-rw-r--r--Applications/IRCClient/IRCClient.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Applications/IRCClient/IRCClient.cpp b/Applications/IRCClient/IRCClient.cpp
index 922716f862..e8cf682339 100644
--- a/Applications/IRCClient/IRCClient.cpp
+++ b/Applications/IRCClient/IRCClient.cpp
@@ -27,10 +27,8 @@ enum IRCNumeric {
RPL_ENDOFNAMES = 366,
};
-IRCClient::IRCClient(const String& address, int port)
- : m_hostname(address)
- , m_port(port)
- , m_nickname("anon")
+IRCClient::IRCClient()
+ : m_nickname("seren1ty")
, m_client_window_list_model(IRCWindowListModel::create(*this))
, m_log(IRCLogBuffer::create())
{
@@ -41,13 +39,18 @@ IRCClient::~IRCClient()
{
}
+void IRCClient::set_server(const String &hostname, int port)
+{
+ m_hostname = hostname;
+ m_port = port;
+}
+
bool IRCClient::connect()
{
if (m_socket->is_connected())
ASSERT_NOT_REACHED();
- IPv4Address ipv4_address(127, 0, 0, 1);
- bool success = m_socket->connect(GSocketAddress(ipv4_address), m_port);
+ bool success = m_socket->connect(m_hostname, m_port);
if (!success)
return false;