From 1ee6c18cfb5eb03f33a5938b37e357dd3fd2c164 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 8 Dec 2005 14:41:53 +0100 Subject: Add abstraction layer for storage --- irc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index c80e138d..9ccfdb33 100644 --- a/irc.c +++ b/irc.c @@ -153,7 +153,7 @@ void irc_free(irc_t * irc) log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd ); if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) - if( !bitlbee_save( irc ) ) + if( !global.storage->save( irc ) ) irc_usermsg( irc, "Error while saving settings!" ); if( irc->ping_source_id > 0 ) -- cgit v1.2.3 From a1f17d45fae99428c8024168b55b4279c59ac867 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 8 Dec 2005 15:14:28 +0100 Subject: Simplify storage API a bit --- irc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 9ccfdb33..255b231c 100644 --- a/irc.c +++ b/irc.c @@ -153,7 +153,7 @@ void irc_free(irc_t * irc) log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd ); if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) - if( !global.storage->save( irc ) ) + if( !global.storage->save( irc, TRUE ) ) irc_usermsg( irc, "Error while saving settings!" ); if( irc->ping_source_id > 0 ) -- cgit v1.2.3 From 7cad7b41a0b661c38ae5f6239aaf58361788edc9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 8 Dec 2005 17:00:08 +0100 Subject: Clearer seperation between crypting and generic password code --- irc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 9ce6eef6..5601e314 100644 --- a/irc.c +++ b/irc.c @@ -31,9 +31,9 @@ static gboolean irc_userping( gpointer _irc ); GSList *irc_connection_list = NULL; -char *passchange (irc_t *irc, void *set, char *value) +static char *passchange (irc_t *irc, void *set, char *value) { - setpassnc (irc, value); + irc_setpass (irc, value); return (NULL); } @@ -267,6 +267,20 @@ void irc_free(irc_t * irc) g_main_quit( global.loop ); } +/* USE WITH CAUTION! + Sets pass without checking */ +void irc_setpass (irc_t *irc, const char *pass) +{ + if (irc->password) g_free (irc->password); + + if (pass) { + irc->password = g_strdup (pass); + irc_usermsg (irc, "Password successfully changed"); + } else { + irc->password = NULL; + } +} + int irc_process( irc_t *irc ) { char **lines, *temp; -- cgit v1.2.3