aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-09-28 12:18:19 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-09-28 12:18:19 +0100
commit94acdd0d7beaa659a5f6b26673c5dea5dbcc4496 (patch)
treec3b60c834729b4b52d9bc0230dbc7f89a2acb03a
parente180c59a7796bb651b96ffaa5757e4688f1d3cc6 (diff)
Restored support for password-protected chatrooms (for now only by accepting
a password in the IRC JOIN command).
-rw-r--r--chat.c4
-rw-r--r--chat.h2
-rw-r--r--irc_commands.c3
-rw-r--r--lib/xmltree.c2
-rw-r--r--lib/xmltree.h2
-rw-r--r--protocols/jabber/conference.c2
-rw-r--r--protocols/jabber/jabber.c2
-rw-r--r--protocols/jabber/jabber.h2
-rw-r--r--protocols/nogaim.c4
-rw-r--r--protocols/nogaim.h4
-rw-r--r--protocols/oscar/oscar.c2
11 files changed, 14 insertions, 15 deletions
diff --git a/chat.c b/chat.c
index d60655de..f7edf2e6 100644
--- a/chat.c
+++ b/chat.c
@@ -169,7 +169,7 @@ int chat_chanok( char *a )
return 0;
}
-int chat_join( irc_t *irc, struct chat *c )
+int chat_join( irc_t *irc, struct chat *c, const char *password )
{
struct groupchat *gc;
char *nick = set_getstr( &c->set, "nick" );
@@ -177,7 +177,7 @@ int chat_join( irc_t *irc, struct chat *c )
if( nick == NULL )
nick = irc->nick;
- if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, NULL ) ) )
+ if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, password ) ) )
{
g_free( gc->channel );
gc->channel = g_strdup( c->channel );
diff --git a/chat.h b/chat.h
index 78e54f24..5aef745c 100644
--- a/chat.h
+++ b/chat.h
@@ -43,4 +43,4 @@ int chat_del( irc_t *irc, struct chat *chat );
int chat_chancmp( char *a, char *b );
int chat_chanok( char *a );
-int chat_join( irc_t *irc, struct chat *c );
+int chat_join( irc_t *irc, struct chat *c, const char *password );
diff --git a/irc_commands.c b/irc_commands.c
index 71a8fb3e..bdca5b24 100644
--- a/irc_commands.c
+++ b/irc_commands.c
@@ -193,12 +193,11 @@ static void irc_cmd_join( irc_t *irc, char **cmd )
else if( cmd[1] )
{
struct chat *c;
- user_t *u;
if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 )
irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] );
else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic )
- chat_join( irc, c );
+ chat_join( irc, c, cmd[2] );
else
irc_reply( irc, 403, "%s :No such channel", cmd[1] );
}
diff --git a/lib/xmltree.c b/lib/xmltree.c
index e65b4f41..67fe46e1 100644
--- a/lib/xmltree.c
+++ b/lib/xmltree.c
@@ -471,7 +471,7 @@ char *xt_find_attr( struct xt_node *node, const char *key )
return node->attr[i].value;
}
-struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children )
+struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children )
{
struct xt_node *node, *c;
diff --git a/lib/xmltree.h b/lib/xmltree.h
index 10677412..34e3be68 100644
--- a/lib/xmltree.h
+++ b/lib/xmltree.h
@@ -89,7 +89,7 @@ void xt_free( struct xt_parser *xt );
struct xt_node *xt_find_node( struct xt_node *node, const char *name );
char *xt_find_attr( struct xt_node *node, const char *key );
-struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children );
+struct xt_node *xt_new_node( char *name, const char *text, struct xt_node *children );
void xt_add_child( struct xt_node *parent, struct xt_node *child );
void xt_add_attr( struct xt_node *node, const char *key, const char *value );
int xt_remove_attr( struct xt_node *node, const char *key );
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c
index 79fdd053..ce2c0b86 100644
--- a/protocols/jabber/conference.c
+++ b/protocols/jabber/conference.c
@@ -25,7 +25,7 @@
static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
-struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
+struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
{
struct jabber_chat *jc;
struct xt_node *node;
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index ac8638cf..b8e88c26 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -424,7 +424,7 @@ static void jabber_remove_buddy( struct im_connection *ic, char *who, char *grou
presence_send_request( ic, who, "unsubscribe" );
}
-static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
+static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password )
{
if( strchr( room, '@' ) == NULL )
imcb_error( ic, "Invalid room name: %s", room );
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 904bf0c4..ee453144 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -239,7 +239,7 @@ xt_status sasl_pkt_result( struct xt_node *node, gpointer data );
gboolean sasl_supported( struct im_connection *ic );
/* conference.c */
-struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
+struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
void jabber_chat_free( struct groupchat *c );
int jabber_chat_msg( struct groupchat *ic, char *message, int flags );
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 20d2f3f1..bec80c25 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -279,7 +279,7 @@ void imcb_connected( struct im_connection *ic )
continue;
if( set_getbool( &c->set, "auto_join" ) )
- chat_join( irc, c );
+ chat_join( irc, c, NULL );
}
}
@@ -709,7 +709,7 @@ void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
}
}
-struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
+struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle )
{
struct groupchat *c;
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 9fe843b5..d828de4c 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -208,7 +208,7 @@ struct prpl {
* your protocol does not support publicly named group chats, then do
* not implement this. */
struct groupchat *
- (* chat_join) (struct im_connection *, char *room, char *nick, char *password);
+ (* chat_join) (struct im_connection *, const char *room, const char *nick, const char *password);
/* Change the topic, if supported. Note that BitlBee expects the IM
server to confirm the topic change with a regular topic change
event. If it doesn't do that, you have to fake it to make it
@@ -289,7 +289,7 @@ G_MODULE_EXPORT void imcb_chat_invited( struct im_connection *ic, char *handle,
* - After you have a groupchat pointer, you should add the handles, finally
* the user her/himself. At that point the group chat will be visible to the
* user, too. */
-G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
+G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
/* To remove a handle from a group chat. Reason can be NULL. */
G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason );
diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c
index 36e03166..8be04259 100644
--- a/protocols/oscar/oscar.c
+++ b/protocols/oscar/oscar.c
@@ -2580,7 +2580,7 @@ void oscar_chat_leave(struct groupchat *c)
oscar_chat_kill(c->ic, c->data);
}
-struct groupchat *oscar_chat_join(struct im_connection * ic, char * room, char * nick, char * password )
+struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
{
struct oscar_data * od = (struct oscar_data *)ic->proto_data;
aim_conn_t * cur;