};
static struct conndata *inuse = NULL;
+static GaimPlugin *me;
static void dcfdcb(struct conndata *data, int fd, GaimInputCondition condition);
}
}
+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;
/* XXX: Handle chat rooms */
if((wwhat = icmbstowcs((char *)what, "UTF-8")) == NULL)
return(-errno);
- dc_queuecmd(NULL, NULL, L"sendchat", L"%%i", fn->id, L"1", L"", L"%%ls", wwhat, NULL);
+ dc_queuecmd(NULL, NULL, L"sendchat", L"%i", fn->id, L"1", L"", L"%ls", wwhat, NULL);
free(wwhat);
updatewrite(data);
return(0);
free(wwho);
return(-en);
}
- dc_queuecmd(NULL, NULL, L"sendchat", L"%%i", fn->id, L"0", L"%%ls", peer->nick, L"%%ls", wwhat, NULL);
+ dc_queuecmd(NULL, NULL, L"sendchat", L"%i", fn->id, L"0", L"%ls", peer->nick, L"%ls", wwhat, NULL);
free(wwho);
free(wwhat);
updatewrite(data);
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 */
}
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);