1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

IRCClient: Start working on a simple graphical IRC client.

This will be a nice way to exercise both LibGUI and the TCP/IP support. :^)
This commit is contained in:
Andreas Kling 2019-03-15 12:14:23 +01:00
parent f87dec1cbf
commit aa19735c5a
18 changed files with 779 additions and 1 deletions

View file

@ -0,0 +1,28 @@
#include "IRCLogBuffer.h"
#include <stdio.h>
#include <time.h>
Retained<IRCLogBuffer> IRCLogBuffer::create()
{
return adopt(*new IRCLogBuffer);
}
IRCLogBuffer::IRCLogBuffer()
{
}
IRCLogBuffer::~IRCLogBuffer()
{
}
void IRCLogBuffer::add_message(char prefix, const String& name, const String& text)
{
m_messages.enqueue({ time(nullptr), prefix, name, text });
}
void IRCLogBuffer::dump() const
{
for (auto& message : m_messages) {
printf("%u <%c%8s> %s\n", message.timestamp, message.prefix, message.sender.characters(), message.text.characters());
}
}