1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:27:35 +00:00

IRCClient: remove some unused headers and replace tabs with spaces

This commit is contained in:
Emanuele Torre 2020-05-28 14:11:51 +02:00 committed by Andreas Kling
parent 68177fd9a1
commit 97b5fbda7f
10 changed files with 18 additions and 31 deletions

View file

@ -41,7 +41,6 @@
#include <LibGUI/ToolBar.h> #include <LibGUI/ToolBar.h>
#include <LibGUI/ToolBarContainer.h> #include <LibGUI/ToolBarContainer.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
static IRCAppWindow* s_the; static IRCAppWindow* s_the;

View file

@ -33,6 +33,7 @@
class IRCAppWindow : public GUI::Window { class IRCAppWindow : public GUI::Window {
C_OBJECT(IRCAppWindow); C_OBJECT(IRCAppWindow);
public: public:
virtual ~IRCAppWindow() override; virtual ~IRCAppWindow() override;

View file

@ -28,7 +28,6 @@
#include "IRCChannelMemberListModel.h" #include "IRCChannelMemberListModel.h"
#include "IRCClient.h" #include "IRCClient.h"
#include <stdio.h> #include <stdio.h>
#include <time.h>
IRCChannel::IRCChannel(IRCClient& client, const String& name) IRCChannel::IRCChannel(IRCClient& client, const String& name)
: m_client(client) : m_client(client)

View file

@ -27,10 +27,9 @@
#pragma once #pragma once
#include "IRCLogBuffer.h" #include "IRCLogBuffer.h"
#include <AK/String.h>
#include <AK/CircularQueue.h>
#include <AK/RefPtr.h>
#include <AK/RefCounted.h> #include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/Vector.h> #include <AK/Vector.h>
class IRCClient; class IRCClient;

View file

@ -35,13 +35,8 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibCore/DateTime.h> #include <LibCore/DateTime.h>
#include <LibCore/Notifier.h> #include <LibCore/Notifier.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <stdio.h>
#include <unistd.h>
#define IRC_DEBUG #define IRC_DEBUG
@ -305,15 +300,15 @@ void IRCClient::handle(const Message& msg)
return handle_rpl_namreply(msg); return handle_rpl_namreply(msg);
case RPL_ENDOFNAMES: case RPL_ENDOFNAMES:
return handle_rpl_endofnames(msg); return handle_rpl_endofnames(msg);
case RPL_BANLIST: case RPL_BANLIST:
return handle_rpl_banlist(msg); return handle_rpl_banlist(msg);
case RPL_ENDOFBANLIST: case RPL_ENDOFBANLIST:
return handle_rpl_endofbanlist(msg); return handle_rpl_endofbanlist(msg);
case ERR_NOSUCHNICK: case ERR_NOSUCHNICK:
return handle_err_nosuchnick(msg); return handle_err_nosuchnick(msg);
case ERR_UNKNOWNCOMMAND: case ERR_UNKNOWNCOMMAND:
return handle_err_unknowncommand(msg); return handle_err_unknowncommand(msg);
case ERR_NICKNAMEINUSE: case ERR_NICKNAMEINUSE:
return handle_err_nicknameinuse(msg); return handle_err_nicknameinuse(msg);
} }
} }
@ -901,7 +896,7 @@ void IRCClient::handle_user_command(const String& input)
auto channel = parts[1]; auto channel = parts[1];
part_channel(channel); part_channel(channel);
join_channel(channel); join_channel(channel);
} else { } else {
auto* window = current_window(); auto* window = current_window();
if (!window || window->type() != IRCWindow::Type::Channel) if (!window || window->type() != IRCWindow::Type::Channel)
return; return;
@ -915,7 +910,7 @@ void IRCClient::handle_user_command(const String& input)
if (parts.size() >= 2) { if (parts.size() >= 2) {
auto channel = parts[1]; auto channel = parts[1];
send_banlist(channel); send_banlist(channel);
} else { } else {
auto* window = current_window(); auto* window = current_window();
if (!window || window->type() != IRCWindow::Type::Channel) if (!window || window->type() != IRCWindow::Type::Channel)
return; return;
@ -936,14 +931,14 @@ void IRCClient::handle_user_command(const String& input)
auto channel = parts[1]; auto channel = parts[1];
auto topic = input.view().substring_view_starting_after_substring(channel); auto topic = input.view().substring_view_starting_after_substring(channel);
send_topic(channel, topic); send_topic(channel, topic);
} else { } else {
auto* window = current_window(); auto* window = current_window();
if (!window || window->type() != IRCWindow::Type::Channel) if (!window || window->type() != IRCWindow::Type::Channel)
return; return;
auto channel = window->channel().name(); auto channel = window->channel().name();
auto topic = input.view().substring_view_starting_after_substring(parts[0]); auto topic = input.view().substring_view_starting_after_substring(parts[0]);
send_topic(channel, topic); send_topic(channel, topic);
} }
return; return;
} }
if (command == "/KICK") { if (command == "/KICK") {
@ -959,7 +954,7 @@ void IRCClient::handle_user_command(const String& input)
auto nick = parts[2]; auto nick = parts[2];
auto reason = input.view().substring_view_starting_after_substring(nick); auto reason = input.view().substring_view_starting_after_substring(nick);
send_kick(channel, nick, reason); send_kick(channel, nick, reason);
} else { } else {
auto* window = current_window(); auto* window = current_window();
if (!window || window->type() != IRCWindow::Type::Channel) if (!window || window->type() != IRCWindow::Type::Channel)
return; return;
@ -967,7 +962,7 @@ void IRCClient::handle_user_command(const String& input)
auto nick = parts[1]; auto nick = parts[1];
auto reason = input.view().substring_view_starting_after_substring(nick); auto reason = input.view().substring_view_starting_after_substring(nick);
send_kick(channel, nick, reason); send_kick(channel, nick, reason);
} }
return; return;
} }
if (command == "/LIST") { if (command == "/LIST") {

View file

@ -31,9 +31,7 @@
#include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/HTMLBodyElement.h> #include <LibWeb/DOM/HTMLBodyElement.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/Dump.h>
#include <LibWeb/Parser/HTMLParser.h> #include <LibWeb/Parser/HTMLParser.h>
#include <stdio.h>
#include <time.h> #include <time.h>
NonnullRefPtr<IRCLogBuffer> IRCLogBuffer::create() NonnullRefPtr<IRCLogBuffer> IRCLogBuffer::create()

View file

@ -27,7 +27,6 @@
#include "IRCQuery.h" #include "IRCQuery.h"
#include "IRCClient.h" #include "IRCClient.h"
#include <stdio.h> #include <stdio.h>
#include <time.h>
IRCQuery::IRCQuery(IRCClient& client, const String& name) IRCQuery::IRCQuery(IRCClient& client, const String& name)
: m_client(client) : m_client(client)

View file

@ -27,10 +27,10 @@
#pragma once #pragma once
#include "IRCLogBuffer.h" #include "IRCLogBuffer.h"
#include <AK/String.h>
#include <AK/CircularQueue.h> #include <AK/CircularQueue.h>
#include <AK/RefPtr.h>
#include <AK/RefCounted.h> #include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/Vector.h> #include <AK/Vector.h>
class IRCClient; class IRCClient;

View file

@ -31,8 +31,8 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibGUI/Action.h> #include <LibGUI/Action.h>
#include <LibGUI/BoxLayout.h> #include <LibGUI/BoxLayout.h>
#include <LibGUI/Menu.h>
#include <LibGUI/InputBox.h> #include <LibGUI/InputBox.h>
#include <LibGUI/Menu.h>
#include <LibGUI/Notification.h> #include <LibGUI/Notification.h>
#include <LibGUI/Splitter.h> #include <LibGUI/Splitter.h>
#include <LibGUI/TableView.h> #include <LibGUI/TableView.h>

View file

@ -27,9 +27,6 @@
#include "IRCWindowListModel.h" #include "IRCWindowListModel.h"
#include "IRCChannel.h" #include "IRCChannel.h"
#include "IRCClient.h" #include "IRCClient.h"
#include "IRCWindow.h"
#include <stdio.h>
#include <time.h>
IRCWindowListModel::IRCWindowListModel(IRCClient& client) IRCWindowListModel::IRCWindowListModel(IRCClient& client)
: m_client(client) : m_client(client)