aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Makefile3
-rw-r--r--protocols/bee.h2
-rw-r--r--protocols/bee_chat.c8
-rw-r--r--protocols/jabber/Makefile3
-rw-r--r--protocols/jabber/jabber.h2
-rw-r--r--protocols/jabber/message.c29
-rw-r--r--protocols/jabber/si.c4
-rw-r--r--protocols/msn/Makefile3
-rw-r--r--protocols/oscar/Makefile3
-rw-r--r--protocols/oscar/oscar.c8
-rw-r--r--protocols/purple/Makefile3
-rw-r--r--protocols/twitter/Makefile3
-rw-r--r--protocols/twitter/twitter.c2
-rw-r--r--protocols/yahoo/Makefile3
-rw-r--r--protocols/yahoo/libyahoo2.c19
15 files changed, 84 insertions, 11 deletions
diff --git a/protocols/Makefile b/protocols/Makefile
index 1c7816bc..9e8d3fb9 100644
--- a/protocols/Makefile
+++ b/protocols/Makefile
@@ -39,6 +39,7 @@ clean: $(subdirs)
rm -f *.o $(OUTFILE) core
distclean: clean $(subdirs)
+ rm -rf .depend
$(subdirs):
@$(MAKE) -C $@ $(MAKECMDGOALS)
@@ -54,3 +55,5 @@ $(objects): ../Makefile.settings Makefile
$(objects): %.o: $(SRCDIR)%.c
@echo '*' Compiling $<
@$(CC) -c $(CFLAGS) $< -o $@
+
+-include .depend/*.d
diff --git a/protocols/bee.h b/protocols/bee.h
index 2fd3562e..b99c8de7 100644
--- a/protocols/bee.h
+++ b/protocols/bee.h
@@ -122,6 +122,7 @@ typedef struct bee_ui_funcs
gboolean (*chat_remove_user)( bee_t *bee, struct groupchat *c, bee_user_t *bu );
gboolean (*chat_topic)( bee_t *bee, struct groupchat *c, const char *new, bee_user_t *bu );
gboolean (*chat_name_hint)( bee_t *bee, struct groupchat *c, const char *name );
+ gboolean (*chat_invite)( bee_t *bee, bee_user_t *bu, const char *name, const char *msg );
struct file_transfer* (*ft_in_start)( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size );
gboolean (*ft_out_start)( struct im_connection *ic, struct file_transfer *ft );
@@ -174,5 +175,6 @@ G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *c, const char *handl
G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *c, const char *handle, const char *reason );
G_MODULE_EXPORT int bee_chat_msg( bee_t *bee, struct groupchat *c, const char *msg, int flags );
G_MODULE_EXPORT struct groupchat *bee_chat_by_title( bee_t *bee, struct im_connection *ic, const char *title );
+G_MODULE_EXPORT void imcb_chat_invite( struct im_connection *ic, const char *name, const char *who, const char *msg );
#endif /* __BEE_H__ */
diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c
index 3be6f189..0314cae5 100644
--- a/protocols/bee_chat.c
+++ b/protocols/bee_chat.c
@@ -232,3 +232,11 @@ struct groupchat *bee_chat_by_title( bee_t *bee, struct im_connection *ic, const
return NULL;
}
+
+void imcb_chat_invite( struct im_connection *ic, const char *name, const char *who, const char *msg )
+{
+ bee_user_t *bu = bee_user_by_handle( ic->bee, ic, who );
+
+ if( bu && ic->bee->ui->chat_invite )
+ ic->bee->ui->chat_invite( ic->bee, bu, name, msg );
+}
diff --git a/protocols/jabber/Makefile b/protocols/jabber/Makefile
index efbd81fb..32946b18 100644
--- a/protocols/jabber/Makefile
+++ b/protocols/jabber/Makefile
@@ -29,6 +29,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -41,3 +42,5 @@ $(objects): %.o: $(SRCDIR)%.c
jabber_mod.o: $(objects)
@echo '*' Linking jabber_mod.o
@$(LD) $(LFLAGS) $(objects) -o jabber_mod.o
+
+-include .depend/*.d
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 45a1c5c1..1523e096 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -58,6 +58,8 @@ typedef enum
groupchat state info too. */
JBFLAG_IS_ANONYMOUS = 8, /* For anonymous chatrooms, when we don't have
have a real JID. */
+ JBFLAG_HIDE_SUBJECT = 16, /* Hide the subject field since we probably
+ showed it already. */
} jabber_buddy_flags_t;
/* Stores a streamhost's (a.k.a. proxy) data */
diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c
index ce5017fb..85c71c9d 100644
--- a/protocols/jabber/message.c
+++ b/protocols/jabber/message.c
@@ -30,7 +30,7 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
char *type = xt_find_attr( node, "type" );
struct xt_node *body = xt_find_node( node->children, "body" ), *c;
struct jabber_buddy *bud = NULL;
- char *s;
+ char *s, *room = NULL, *reason = NULL;
if( !from )
return XT_HANDLED; /* Consider this packet corrupted. */
@@ -51,19 +51,19 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
for( c = node->children; ( c = xt_find_node( c, "x" ) ); c = c->next )
{
- char *ns = xt_find_attr( c, "xmlns" ), *room;
- struct xt_node *inv, *reason;
+ char *ns = xt_find_attr( c, "xmlns" );
+ struct xt_node *inv;
if( ns && strcmp( ns, XMLNS_MUC_USER ) == 0 &&
( inv = xt_find_node( c->children, "invite" ) ) )
{
+ /* This is an invitation. Set some vars which
+ will be passed to imcb_chat_invite() below. */
room = from;
if( ( from = xt_find_attr( inv, "from" ) ) == NULL )
from = room;
-
- g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Invitation to chatroom %s >>\n", room );
- if( ( reason = xt_find_node( inv->children, "reason" ) ) && reason->text_len > 0 )
- g_string_append( fullmsg, reason->text );
+ if( ( inv = xt_find_node( inv->children, "reason" ) ) && inv->text_len > 0 )
+ reason = inv->text;
}
}
@@ -92,9 +92,20 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
g_string_append_printf( fullmsg, "URL: %s\n", url->text );
}
}
- else if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 )
+ else if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 &&
+ ( !bud || !( bud->flags & JBFLAG_HIDE_SUBJECT ) ) )
{
g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Message with subject: %s >>\n", c->text );
+ if( bud )
+ bud->flags |= JBFLAG_HIDE_SUBJECT;
+ }
+ else if( bud && !c )
+ {
+ /* Yeah, possibly we're hiding changes to this field now. But nobody uses
+ this for anything useful anyway, except GMail when people reply to an
+ e-mail via chat, repeating the same subject all the time. I don't want
+ to have to remember full subject strings for everyone. */
+ bud->flags &= ~JBFLAG_HIDE_SUBJECT;
}
if( body && body->text_len > 0 ) /* Could be just a typing notification. */
@@ -103,6 +114,8 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
if( fullmsg->len > 0 )
imcb_buddy_msg( ic, from, fullmsg->str,
0, jabber_get_timestamp( node ) );
+ if( room )
+ imcb_chat_invite( ic, room, from, reason );
g_string_free( fullmsg, TRUE );
diff --git a/protocols/jabber/si.c b/protocols/jabber/si.c
index 454d56b9..4b0e57c4 100644
--- a/protocols/jabber/si.c
+++ b/protocols/jabber/si.c
@@ -261,6 +261,10 @@ int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, st
requestok = TRUE;
break;
}
+ else
+ {
+ c = c->next;
+ }
if ( !requestok )
imcb_log( ic, "WARNING: Unsupported file transfer request from %s", ini_jid);
diff --git a/protocols/msn/Makefile b/protocols/msn/Makefile
index 781482f5..068d7e98 100644
--- a/protocols/msn/Makefile
+++ b/protocols/msn/Makefile
@@ -29,6 +29,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -41,5 +42,5 @@ $(objects): %.o: $(SRCDIR)%.c
msn_mod.o: $(objects)
@echo '*' Linking msn_mod.o
@$(LD) $(LFLAGS) $(objects) -o msn_mod.o
-
+-include .depend/*.d
diff --git a/protocols/oscar/Makefile b/protocols/oscar/Makefile
index c1a966ad..a83830df 100644
--- a/protocols/oscar/Makefile
+++ b/protocols/oscar/Makefile
@@ -30,6 +30,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -42,3 +43,5 @@ $(objects): %.o: $(SRCDIR)%.c
oscar_mod.o: $(objects)
@echo '*' Linking oscar_mod.o
@$(LD) $(LFLAGS) $(objects) -o oscar_mod.o
+
+-include .depend/*.d
diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c
index aba08c1f..3eea5825 100644
--- a/protocols/oscar/oscar.c
+++ b/protocols/oscar/oscar.c
@@ -516,6 +516,14 @@ static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) {
case 0x05:
/* Incorrect nick/password */
imcb_error(ic, _("Incorrect nickname or password."));
+ {
+ int max = od->icq ? 8 : 16;
+ if (strlen(ic->acc->pass) > max)
+ imcb_log(ic, "Note that the maximum password "
+ "length supported by this protocol is "
+ "%d characters, try logging in using "
+ "a shorter password.", max);
+ }
// plugin_event(event_error, (void *)980, 0, 0, 0);
break;
case 0x11:
diff --git a/protocols/purple/Makefile b/protocols/purple/Makefile
index 97a5bb6a..62115abf 100644
--- a/protocols/purple/Makefile
+++ b/protocols/purple/Makefile
@@ -30,6 +30,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -42,3 +43,5 @@ $(objects): %.o: $(SRCDIR)%.c
purple_mod.o: $(objects)
@echo '*' Linking purple_mod.o
$(LD) $(LFLAGS) $(objects) -o purple_mod.o
+
+-include .depend/*.d
diff --git a/protocols/twitter/Makefile b/protocols/twitter/Makefile
index 3fa9b61e..74f0ea11 100644
--- a/protocols/twitter/Makefile
+++ b/protocols/twitter/Makefile
@@ -29,6 +29,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -42,4 +43,4 @@ twitter_mod.o: $(objects)
@echo '*' Linking twitter_mod.o
@$(LD) $(LFLAGS) $(objects) -o twitter_mod.o
-
+-include .depend/*.d
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index 16b069ee..1bc596eb 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -194,7 +194,7 @@ static void twitter_init( account_t *acc )
s = set_add( &acc->set, "message_length", "140", set_eval_int, acc );
- s = set_add( &acc->set, "mode", "one", set_eval_mode, acc );
+ s = set_add( &acc->set, "mode", "chat", set_eval_mode, acc );
s->flags |= ACC_SET_OFFLINE_ONLY;
s = set_add( &acc->set, "oauth", def_oauth, set_eval_bool, acc );
diff --git a/protocols/yahoo/Makefile b/protocols/yahoo/Makefile
index a8021ffb..7908b773 100644
--- a/protocols/yahoo/Makefile
+++ b/protocols/yahoo/Makefile
@@ -30,6 +30,7 @@ clean:
rm -f *.o core
distclean: clean
+ rm -rf .depend
### MAIN PROGRAM
@@ -42,3 +43,5 @@ $(objects): %.o: $(SRCDIR)%.c
yahoo_mod.o: $(objects)
@echo '*' Linking yahoo_mod.o
@$(LD) $(LFLAGS) $(objects) -o yahoo_mod.o
+
+-include .depend/*.d
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c
index b062e7f9..07689809 100644
--- a/protocols/yahoo/libyahoo2.c
+++ b/protocols/yahoo/libyahoo2.c
@@ -2168,6 +2168,18 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid,
yd->buddies = y_list_append(yd->buddies, bud);
+#if 0
+ /* BitlBee: This seems to be wrong in my experience. I think:
+ status = 0: Success
+ status = 2: Already on list
+ status = 3: Doesn't exist
+ status = 42: Invalid handle (possibly banned/reserved, I get it for
+ handles like joe or jjjjjj)
+ Haven't seen others yet. But whenever the add is successful, there
+ will be a separate "went online" packet when the auth. request is
+ accepted. Couldn't find any test account that doesn't require auth.
+ unfortunately (if there is even such a thing?) */
+
/* A non-zero status (i've seen 2) seems to mean the buddy is already
* added and is online */
if (status) {
@@ -2176,6 +2188,13 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid,
YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->client_id, who,
YAHOO_STATUS_AVAILABLE, NULL, 0, 0, 0);
}
+#endif
+ /* BitlBee: Need ACK of added buddy, if it was successful. */
+ if (status == 0) {
+ YList *tmp = y_list_append(NULL, bud);
+ YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id, tmp);
+ y_list_free(tmp);
+ }
}
static void yahoo_process_buddydel(struct yahoo_input_data *yid,