#include "ChanNode.h"
#include "ModeNode.h"
#include "UserNode.h"
+#include "log.h"
struct ChanUser* addChanUser(struct ChanNode *chan, struct UserNode *user) {
- if(isUserOnChan(user, chan)) {
- putlog(LOGLEVEL_ERROR, "CACHE FAIL");
- }
struct ChanUser *chanuser = malloc(sizeof(*chanuser));
if (!chanuser)
{
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
chanuser->flags = 0;
struct ChanUser *chanuser = malloc(sizeof(*chanuser));
if (!chanuser)
{
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
chanuser->flags = CHANUSERFLAG_INVISIBLE;