Enable IRC protocol

This commit is contained in:
Jaidyn Ann 2021-06-21 03:06:15 -05:00
parent 4ee453d0d6
commit 31bc304c0b
3 changed files with 15 additions and 6 deletions

View File

@ -10,8 +10,9 @@ You can make Caya and its protocols with:
`$ make`
Caya itself requires the `expat_devel` package, and the XMPP protocol requires
`gloox_devel`. You can also build either independent of the other:
Caya itself requires the `expat_devel` package, the XMPP protocol requires
`gloox_devel`, and the (provisional) IRC protocol requires
`libircclient_devel`. You can also build either independent of the other:
`$ make caya; make protocols`
`$ make caya; make libs; make protocols; make -f protocols/xmpp/Makefile`

View File

@ -6,6 +6,6 @@ irc:
xmpp:
$(MAKE) -f protocols/xmpp/Makefile
all: xmpp
all: xmpp irc
default: all

View File

@ -5,7 +5,7 @@
#include "IrcProtocol.h"
#include <iostream>
#include <cstdio>
#include <StringList.h>
@ -319,6 +319,15 @@ event_numeric(irc_session_t* session, unsigned int event,
_SendMessage(&list);
break;
}
case LIBIRC_RFC_RPL_TOPIC:
{
BMessage topic(IM_MESSAGE);
topic.AddInt32("im_what", IM_ROOM_SUBJECT_SET);
topic.AddString("chat_id", params[1]);
topic.AddString("subject", params[2]);
_SendMessage(&topic);
break;
}
}
}
@ -430,7 +439,6 @@ _IsOwnUser(const char* userId, irc_session_t* session)
BMessage ownInfo(IM_MESSAGE);
ownInfo.AddInt32("im_what", IM_OWN_CONTACT_INFO);
ownInfo.AddString("user_id", userId);
ownInfo.AddString("user_name", ctx->nick);
_SendMessage(&ownInfo);
}
}