From: fredrik Date: Sat, 14 Apr 2007 01:36:21 +0000 (+0000) Subject: Try to hide join/leave messages. X-Git-Tag: 0.3~10 X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=649eeeb6cf1ab37d2350146d49c126ee775194f4 Try to hide join/leave messages. Update gi_tiptext to beta6. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@927 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/clients/gaim/gaim-dolcon.c b/clients/gaim/gaim-dolcon.c index 6d29726..94199d7 100644 --- a/clients/gaim/gaim-dolcon.c +++ b/clients/gaim/gaim-dolcon.c @@ -40,6 +40,7 @@ struct conndata { }; static struct conndata *inuse = NULL; +static GaimPlugin *me; static void dcfdcb(struct conndata *data, int fd, GaimInputCondition condition); @@ -89,6 +90,28 @@ static int loginconv(int type, wchar_t *text, char **resp, struct conndata *data } } +static gboolean gi_chatjoincb(GaimConversation *conv, const char *user, GaimConvChatBuddyFlags flags, void *uudata) +{ + GaimConnection *c; + + if((c = gaim_conversation_get_gc(conv)) == NULL) + return(FALSE); + if(c->prpl == me) + return(TRUE); + return(FALSE); +} + +static gboolean gi_chatleavecb(GaimConversation *conv, const char *user, const char *reason, void *uudata) +{ + GaimConnection *c; + + if((c = gaim_conversation_get_gc(conv)) == NULL) + return(FALSE); + if(c->prpl == me) + return(TRUE); + return(FALSE); +} + static void newpeercb(struct dc_fnetpeer *peer) { struct conndata *data; @@ -315,7 +338,7 @@ static char *gi_statustext(GaimBuddy *b) return(NULL); } -static void gi_tiptext(GaimBuddy *b, GString *buf, gboolean full) +static void gi_tiptext(GaimBuddy *b, GaimNotifyUserInfo *inf, gboolean full) { /* Nothing for now */ } @@ -507,10 +530,11 @@ static void init(GaimPlugin *pl) dc_init(); opt = gaim_account_option_string_new("Server", "server", ""); protinfo.protocol_options = g_list_append(protinfo.protocol_options, opt); - opt = gaim_account_option_int_new("Port", "port", -1); - protinfo.protocol_options = g_list_append(protinfo.protocol_options, opt); opt = gaim_account_option_bool_new("Do not pop up private messages automatically", "represspm", FALSE); protinfo.protocol_options = g_list_append(protinfo.protocol_options, opt); + gaim_signal_connect(gaim_conversations_get_handle(), "chat-buddy-joining", pl, GAIM_CALLBACK(gi_chatjoincb), NULL); + gaim_signal_connect(gaim_conversations_get_handle(), "chat-buddy-leaving", pl, GAIM_CALLBACK(gi_chatleavecb), NULL); + me = pl; } GAIM_INIT_PLUGIN(dolcon, init, info);