diff options
Diffstat (limited to 'protocols/twitter')
-rw-r--r-- | protocols/twitter/Makefile | 5 | ||||
-rw-r--r-- | protocols/twitter/twitter.c | 24 | ||||
-rw-r--r-- | protocols/twitter/twitter_lib.c | 2 |
3 files changed, 27 insertions, 4 deletions
diff --git a/protocols/twitter/Makefile b/protocols/twitter/Makefile index ca1e4695..8a4b97f9 100644 --- a/protocols/twitter/Makefile +++ b/protocols/twitter/Makefile @@ -7,6 +7,9 @@ ### DEFINITIONS -include ../../Makefile.settings +ifdef SRCDIR +SRCDIR := $(SRCDIR)protocols/twitter/ +endif # [SH] Program variables objects = twitter.o twitter_http.o twitter_lib.o @@ -32,7 +35,7 @@ distclean: clean $(objects): ../../Makefile.settings Makefile -$(objects): %.o: %.c +$(objects): %.o: $(SRCDIR)%.c @echo '*' Compiling $< @$(CC) -c $(CFLAGS) $< -o $@ diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 2e3ab634..f3fe8922 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -315,8 +315,28 @@ static void twitter_remove_buddy( struct im_connection *ic, char *who, char *gro static void twitter_chat_msg( struct groupchat *c, char *message, int flags ) { - if( c && message && twitter_length_check(c->ic, message)) - twitter_post_status(c->ic, message); + if( c && message && twitter_length_check( c->ic, message ) ) + { + char *s, *new = NULL; + + if( ( s = strchr( message, ':' ) ) || + ( s = strchr( message, ',' ) ) ) + { + bee_user_t *bu; + + new = g_strdup( message ); + new[s-message] = '\0'; + if( ( bu = bee_user_by_handle( c->ic->bee, c->ic, new ) ) ) + { + sprintf( new, "@%s", bu->handle ); + new[s-message+1] = ' '; + message = new; + } + } + + twitter_post_status( c->ic, message ); + g_free( new ); + } } static void twitter_chat_invite( struct groupchat *c, char *who, char *message ) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 0578c5e0..b4b460d3 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -116,7 +116,7 @@ static void twitter_add_buddy(struct im_connection *ic, char *name, const char * struct twitter_data *td = ic->proto_data; // Check if the buddy is allready in the buddy list. - if (!imcb_find_buddy( ic, name )) + if (!bee_user_by_handle( ic->bee, ic, name )) { char *mode = set_getstr(&ic->acc->set, "mode"); |