aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-08-25 00:06:52 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-08-25 00:06:52 +0200
commit0383943c38ee308805798974bfccbd3327369c6a (patch)
tree73e72fe7177ada30828780ac7b6e7c3fc6a61f94
parent9829ae028dc1f0d8ab60cb18293234f2d4cc19b8 (diff)
Added message on successful creation of accounts and fixed "set password"
command.
-rw-r--r--irc.c4
-rw-r--r--root_commands.c1
-rw-r--r--set.c2
-rw-r--r--set.h6
4 files changed, 9 insertions, 4 deletions
diff --git a/irc.c b/irc.c
index 87cc4c78..8f79b535 100644
--- a/irc.c
+++ b/irc.c
@@ -32,8 +32,10 @@ static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );
GSList *irc_connection_list = NULL;
-static char *passchange( irc_t *irc, void *set, char *value )
+static char *passchange( set_t *set, char *value )
{
+ irc_t *irc = set->data;
+
irc_setpass( irc, value );
irc_usermsg( irc, "Password successfully changed" );
return NULL;
diff --git a/root_commands.c b/root_commands.c
index 13567e8a..3097dc81 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -168,6 +168,7 @@ static void cmd_register( irc_t *irc, char **cmd )
break;
case STORAGE_OK:
+ irc_usermsg( irc, "Account successfully created" );
irc->status |= USTATUS_IDENTIFIED;
irc_umode_set( irc, "+R", 1 );
break;
diff --git a/set.c b/set.c
index 4620264f..6a45fd14 100644
--- a/set.c
+++ b/set.c
@@ -25,7 +25,7 @@
#define BITLBEE_CORE
#include "bitlbee.h"
-set_t *set_add( set_t **head, char *key, char *def, void *eval, void *data )
+set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data )
{
set_t *s = set_find( head, key );
diff --git a/set.h b/set.h
index 14043c2f..37d2430f 100644
--- a/set.h
+++ b/set.h
@@ -33,6 +33,8 @@
every setting, which can check a new value and block it by returning
NULL, or replace it by returning a new value. See struct set.eval. */
+typedef char *(*set_eval) ( struct set *set, char *value );
+
typedef struct set
{
void *data; /* Here you can save a pointer to the
@@ -51,12 +53,12 @@ typedef struct set
/* Eval: Returns NULL if the value is incorrect or exactly the
passed value variable. When returning a corrected value,
set_setstr() should be able to free() the returned string! */
- char *(*eval) ( struct set *set, char *value );
+ set_eval eval;
struct set *next;
} set_t;
/* Should be pretty clear. */
-set_t *set_add( set_t **head, char *key, char *def, void *eval, void *data );
+set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data );
/* Returns the raw set_t. Might be useful sometimes. */
set_t *set_find( set_t **head, char *key );