Commit 2076a6f8 authored by Romain Bignon's avatar Romain Bignon

renamed bitlbee2 to Minbif

parent 7f3f7b09
PROJECT(bitlbee2)
PROJECT(minbif)
cmake_minimum_required(VERSION 2.6)
SET(BIN_NAME bitlbee2)
SET(BIN_NAME minbif)
ADD_EXECUTABLE(${BIN_NAME}
src/bitlbee.cpp
src/minbif.cpp
src/util.cpp
src/log.cpp
src/mutex.cpp
......@@ -30,7 +30,7 @@ ADD_EXECUTABLE(${BIN_NAME}
src/irc/status_channel.cpp
src/irc/conversation_channel.cpp
)
SET(CONF_NAME bitlbee.conf)
SET(CONF_NAME minbif.conf)
target_link_libraries(${BIN_NAME})
......@@ -75,8 +75,8 @@ MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
INSTALL(TARGETS ${BIN_NAME}
DESTINATION bin)
INSTALL(FILES ${CONF_NAME}
DESTINATION etc/bitlbee)
DESTINATION etc/minbif)
INSTALL(FILES COPYING README
DESTINATION doc/bitlbee)
DESTINATION doc/minbif)
INSTALL(DIRECTORY doc/
DESTINATION doc/bitlbee)
DESTINATION doc/minbif)
ENABLE_CACA ?= ON
CMAKE_OPTIONS = -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=0 -DENABLE_CACA=$(ENABLE_CACA)
all: build.bitlbee/Makefile
make -C build.bitlbee all
all: build.minbif/Makefile
make -C build.minbif all
build.bitlbee/Makefile:
[ -d build.bitlbee ] || mkdir build.bitlbee; \
cd build.bitlbee && cmake $(CMAKE_OPTIONS) ..
build.minbif/Makefile:
[ -d build.minbif ] || mkdir build.minbif; \
cd build.minbif && cmake $(CMAKE_OPTIONS) ..
install:
make -C build.bitlbee install
make -C build.minbif install
clean:
rm -rf build.bitlbee
rm -rf build.minbif
rm -rf release
doc:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
# Path settings
path {
users = /var/lib/bitlbee/users
users = /var/lib/minbif/users
}
irc {
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -61,7 +61,7 @@ string Account::getUsername() const
string Account::getID() const
{
assert(isValid());
string n = purple_account_get_ui_string(account, BITLBEE_VERSION_NAME, "id", "");
string n = purple_account_get_ui_string(account, MINBIF_VERSION_NAME, "id", "");
if(n.empty())
n = Purple::getNewAccountName(proto);
return n;
......@@ -70,14 +70,14 @@ string Account::getID() const
string Account::getStatusChannel() const
{
assert(isValid());
string n = purple_account_get_ui_string(account, BITLBEE_VERSION_NAME, "channel", "");
string n = purple_account_get_ui_string(account, MINBIF_VERSION_NAME, "channel", "");
return n;
}
void Account::setStatusChannel(string c)
{
assert(isValid());
purple_account_set_ui_string(account, BITLBEE_VERSION_NAME, "channel", c.c_str());
purple_account_set_ui_string(account, MINBIF_VERSION_NAME, "channel", c.c_str());
}
string Account::getServername() const
......@@ -114,13 +114,13 @@ vector<Buddy> Account::getBuddies() const
void Account::connect() const
{
assert(isValid());
purple_account_set_enabled(account, BITLBEE_VERSION_NAME, true);
purple_account_set_enabled(account, MINBIF_VERSION_NAME, true);
}
void Account::disconnect() const
{
assert(isValid());
purple_account_set_enabled(account, BITLBEE_VERSION_NAME, false);
purple_account_set_enabled(account, MINBIF_VERSION_NAME, false);
}
void Account::createStatusChannel() const
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -33,7 +33,7 @@ namespace im
/** This class represents an account.
*
* This class only interfaces between the bitlbee2 code
* This class only interfaces between the minbif code
* and a libpurple account object.
*/
class Account
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -32,7 +32,7 @@ namespace im
/** This class represents a buddy.
*
* This class only interfaces between the bitlbee2 code
* This class only interfaces between the minbif code
* and a libpurple account object.
*/
class Buddy
......@@ -67,7 +67,7 @@ namespace im
/** Get username of buddy */
string getName() const;
/** Get bitlbee2 alias */
/** Get minbif alias */
string getAlias() const;
/** Get IM real name */
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -96,12 +96,12 @@ IM::~IM()
void IM::setPassword(const string& password)
{
purple_prefs_set_string("/bitlbee/password", password.c_str());
purple_prefs_set_string("/minbif/password", password.c_str());
}
string IM::getPassword() const
{
return purple_prefs_get_string("/bitlbee/password");
return purple_prefs_get_string("/minbif/password");
}
map<string, Protocol> IM::getProtocolsList() const
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -72,23 +73,23 @@ void Purple::debug_init()
purple_debug_set_ui_ops(&debug_ops);
}
void Purple::bitlbee_prefs_init()
void Purple::minbif_prefs_init()
{
purple_prefs_add_none("/bitlbee");
purple_prefs_add_none("/minbif");
purple_prefs_add_string("/bitlbee/password", "");
purple_prefs_add_string("/minbif/password", "");
}
GHashTable *Purple::ui_info = NULL;
GHashTable *Purple::bitlbee_ui_get_info(void)
GHashTable *Purple::minbif_ui_get_info(void)
{
if (ui_info == NULL) {
ui_info = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_insert(ui_info, (void*)"name", (void*)BITLBEE_VERSION_NAME);
g_hash_table_insert(ui_info, (void*)"version", (void*)BITLBEE_VERSION);
g_hash_table_insert(ui_info, (void*)"website", (void*)"http://symlink.me/wiki/bitlbee");
g_hash_table_insert(ui_info, (void*)"dev_website", (void*)"http://symlink.me/projects/show/bitlbee2");
g_hash_table_insert(ui_info, (void*)"name", (void*)MINBIF_VERSION_NAME);
g_hash_table_insert(ui_info, (void*)"version", (void*)MINBIF_VERSION);
g_hash_table_insert(ui_info, (void*)"website", (void*)"http://symlink.me/wiki/minbif");
g_hash_table_insert(ui_info, (void*)"dev_website", (void*)"http://symlink.me/projects/show/minbif");
}
return ui_info;
......@@ -97,11 +98,11 @@ GHashTable *Purple::bitlbee_ui_get_info(void)
PurpleCoreUiOps Purple::core_ops =
{
Purple::bitlbee_prefs_init,
Purple::minbif_prefs_init,
Purple::debug_init,
Purple::inited,//gnt_ui_init,
NULL,//bitlbee_quit,
Purple::bitlbee_ui_get_info,
NULL,//minbif_quit,
Purple::minbif_ui_get_info,
/* padding */
NULL,
......@@ -122,7 +123,7 @@ void Purple::init(IM* im)
purple_eventloop_set_ui_ops(&eventloop_ops);
Purple::im = im;
if (!purple_core_init(BITLBEE_VERSION_NAME))
if (!purple_core_init(MINBIF_VERSION_NAME))
{
b_log[W_ERR] << "Initialization of the Purple core failed.";
throw PurpleError();
......@@ -203,7 +204,7 @@ string Purple::getNewAccountName(Protocol proto)
if(account_proto != proto)
continue;
string id = purple_account_get_ui_string(((PurpleAccount*)list->data), BITLBEE_VERSION_NAME, "id", "");
string id = purple_account_get_ui_string(((PurpleAccount*)list->data), MINBIF_VERSION_NAME, "id", "");
if(id == proto.getID() + t2s(i))
i = s2t<int>(id.substr(proto.getID().size())) + 1;
}
......@@ -218,7 +219,7 @@ Account Purple::addAccount(Protocol proto, string username, string password, vec
purple_accounts_add(account);
purple_account_set_remember_password(account, TRUE);
purple_account_set_password(account, password.c_str());
purple_account_set_ui_string(account, BITLBEE_VERSION_NAME, "id", id.c_str());
purple_account_set_ui_string(account, MINBIF_VERSION_NAME, "id", id.c_str());
FOREACH(vector<Protocol::Option>, options, it)
{
......@@ -251,7 +252,7 @@ Account Purple::addAccount(Protocol proto, string username, string password, vec
saved_status = purple_savedstatus_get_current();
if (saved_status != NULL) {
purple_savedstatus_activate_for_account(saved_status, account);
purple_account_set_enabled(account, BITLBEE_VERSION_NAME, TRUE);
purple_account_set_enabled(account, MINBIF_VERSION_NAME, TRUE);
}
return Account(account, proto);
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -40,7 +41,7 @@ namespace im
* username per process, as there are ugly static variables
* to store states.
*
* This class is used to interface the POO-style of bitlbee2
* This class is used to interface the POO-style of minbif
* with the poor C-static-style of libpurple.
*/
class Purple
......@@ -58,8 +59,8 @@ namespace im
static PurpleCoreUiOps core_ops;
static PurpleDebugUiOps debug_ops;
static GHashTable *bitlbee_ui_get_info(void);
static void bitlbee_prefs_init();
static GHashTable *minbif_ui_get_info(void);
static void minbif_prefs_init();
static void debug_init();
static void debug(PurpleDebugLevel level, const char *category, const char *args);
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -66,7 +66,7 @@ IRC::command_t IRC::commands[] = {
};
IRC::IRC(ServerPoll* _poll, int _fd, string _hostname, unsigned _ping_freq)
: Server("localhost.localdomain", BITLBEE_VERSION),
: Server("localhost.localdomain", MINBIF_VERSION),
poll(_poll),
fd(_fd),
read_id(0),
......@@ -124,7 +124,7 @@ IRC::IRC(ServerPoll* _poll, int _fd, string _hostname, unsigned _ping_freq)
ping_cb = new CallBack<IRC>(this, &IRC::ping);
ping_id = g_timeout_add_seconds((int)ping_freq, g_callback, ping_cb);
user->send(Message(MSG_NOTICE).setSender(this).setReceiver("AUTH").addArg("BitlBee-IRCd initialized, please go on"));
user->send(Message(MSG_NOTICE).setSender(this).setReceiver("AUTH").addArg("Minbif-IRCd initialized, please go on"));
}
IRC::~IRC()
......@@ -315,8 +315,8 @@ void IRC::sendWelcome()
user->setFlag(Nick::REGISTERED);
user->send(Message(RPL_WELCOME).setSender(this).setReceiver(user).addArg("Welcome to the BitlBee gateway, " + user->getNickname() + "!"));
user->send(Message(RPL_YOURHOST).setSender(this).setReceiver(user).addArg("Host " + getServerName() + " is running BitlBee 2.0"));
user->send(Message(RPL_WELCOME).setSender(this).setReceiver(user).addArg("Welcome to the Minbif gateway, " + user->getNickname() + "!"));
user->send(Message(RPL_YOURHOST).setSender(this).setReceiver(user).addArg("Host " + getServerName() + " is running Minbif"));
user->send(Message(RPL_MOTDSTART).setSender(this).setReceiver(user).addArg("- " + getServerName() + " Message Of The Day -"));
if (im->getAccountsList().empty())
......@@ -503,7 +503,7 @@ void IRC::m_version(Message message)
{
user->send(Message(RPL_VERSION).setSender(this)
.setReceiver(user)
.addArg(BITLBEE_VERSION)
.addArg(MINBIF_VERSION)
.addArg(getServerName()));
}
......@@ -1158,7 +1158,7 @@ void IRC::m_invite(Message message)
account = im->getAccountFromChannel(chan->getName());
else
account = im->getAccount(acc);
account.addBuddy(username, "bitlbee");
account.addBuddy(username, "minbif");
user->send(Message(RPL_INVITING).setSender(this)
.setReceiver(user)
.addArg(username)
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -113,7 +113,7 @@ namespace irc
/** Create an instance of the IRC class
*
* @param poll the server poll used by bitlbee2
* @param poll the server poll used by minbif
* @param fd file descriptor where read and write to user
* @param hostname server's hostname
* @param ping_freq frequence of pings
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Bitlbee v2 - IRC instant messaging gateway
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -22,7 +23,7 @@
namespace irc
{
/** This class represents user connected to bitlbee2 */
/** This class represents user connected to minbif */
class User : public Nick
{
int fd;
......
/*
* Copyright(C) 2008-2009 Laurent Defert, Romain Bignon
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -80,7 +81,7 @@ Log::Log()
: logged_flags(DEFAULT_LOGGED_FLAGS),
poll(NULL)
{
openlog("bitlbee", LOG_CONS, LOG_DAEMON);
openlog("minbif", LOG_CONS, LOG_DAEMON);
}
Log::~Log()
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -19,14 +20,14 @@
#include <sys/resource.h>
#include <libpurple/purple.h>
#include "bitlbee.h"
#include "minbif.h"
#include "config.h"
#include "log.h"
#include "util.h"
#include "im/im.h"
#include "server_poll/poll.h"
Bitlbee::Bitlbee()
Minbif::Minbif()
: loop(0), server_poll(0)
{
ConfigSection* section;
......@@ -43,12 +44,12 @@ Bitlbee::Bitlbee()
section->AddItem(new ConfigItem_bool("to_syslog", "Log error and warnings to syslog"));
}
Bitlbee::~Bitlbee()
Minbif::~Minbif()
{
delete server_poll;
}
int Bitlbee::main(int argc, char** argv)
int Minbif::main(int argc, char** argv)
{
if(argc < 2)
{
......@@ -102,13 +103,13 @@ int Bitlbee::main(int argc, char** argv)
return EXIT_FAILURE;
}
void Bitlbee::quit()
void Minbif::quit()
{
g_main_quit(loop);
}
int main(int argc, char** argv)
{
Bitlbee bitlbee;
exit(bitlbee.main(argc, argv));
Minbif minbif;
exit(minbif.main(argc, argv));
}
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,21 +16,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef BITLBEE_H
#define BITLBEE_H
#ifndef MINBIF_H
#define MINBIF_H
class ServerPoll;
struct _GMainLoop;
class Bitlbee
class Minbif
{
struct _GMainLoop *loop;
ServerPoll* server_poll;
public:
Bitlbee();
~Bitlbee();
Minbif();
~Minbif();
int main(int argc, char** argv);
......@@ -37,4 +38,4 @@ public:
};
#endif /* BITLBEE_H */
#endif /* MINBIF_H */
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -24,9 +25,9 @@
#include "../config.h"
#include "../callback.h"
#include "../log.h"
#include "../bitlbee.h"
#include "../minbif.h"
InetdServerPoll::InetdServerPoll(Bitlbee* application)
InetdServerPoll::InetdServerPoll(Minbif* application)
: ServerPoll(application),
irc(NULL),
stop_cb(NULL)
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -32,7 +33,7 @@ class InetdServerPoll : public ServerPoll
public:
InetdServerPoll(Bitlbee* application);
InetdServerPoll(Minbif* application);
~InetdServerPoll();
void kill(irc::IRC* irc);
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -19,7 +20,7 @@
#include "inetd.h"
#include "../log.h"
ServerPoll* ServerPoll::build(ServerPoll::poll_type_t type, Bitlbee* application)
ServerPoll* ServerPoll::build(ServerPoll::poll_type_t type, Minbif* application)
{
switch(type)
{
......@@ -34,6 +35,6 @@ ServerPoll* ServerPoll::build(ServerPoll::poll_type_t type, Bitlbee* application
return 0;
}
ServerPoll::ServerPoll(Bitlbee* _app)
ServerPoll::ServerPoll(Minbif* _app)
: application(_app)
{}
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -23,7 +24,7 @@
using std::string;
class Bitlbee;
class Minbif;
namespace irc
{
......@@ -34,11 +35,11 @@ class ServerPollError : public std::exception {};
class ServerPoll
{
Bitlbee* application;
Minbif* application;
protected:
Bitlbee* getApplication() const { return application; }
Minbif* getApplication() const { return application; }
public:
......@@ -49,9 +50,9 @@ public:
DAEMON_FORK
};
static ServerPoll* build(poll_type_t type, Bitlbee* application);
static ServerPoll* build(poll_type_t type, Minbif* application);
ServerPoll(Bitlbee* application);
ServerPoll(Minbif* application);
virtual void kill(irc::IRC* irc) = 0;
......
/*
* Minbif - IRC instant messaging gateway
* Copyright(C) 2009 Romain Bignon
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,13 +19,13 @@
#ifndef VERSION_H
#define VERSION_H
#define BITLBEE_VERSION_NAME "bitlbee"
#define MINBIF_VERSION_NAME "minbif"
#define BITLBEE_VERSION_MAJOR "2"
#define BITLBEE_VERSION_MINOR "0"
#define MINBIF_VERSION_MAJOR "2"
#define MINBIF_VERSION_MINOR "0-alpha"
#define BITLBEE_VERSION BITLBEE_VERSION_NAME \
BITLBEE_VERSION_MAJOR "." \
BITLBEE_VERSION_MINOR
#define MINBIF_VERSION MINBIF_VERSION_NAME \
MINBIF_VERSION_MAJOR "." \
MINBIF_VERSION_MINOR
#endif /* VERSION_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment