Commit 31e2ef8e authored by Richard Bayerle's avatar Richard Bayerle
Browse files

Checks if conversation is an XMPP one before trying to set topic.

This should fix #18.
parent 892d96bf
......@@ -28,7 +28,7 @@ PKGCFG_C=$(shell pkg-config --cflags glib-2.0 purple) $(shell xml2-config --cfl
PKGCFG_L=$(shell pkg-config --libs purple glib-2.0 sqlite3 mxml) $(shell xml2-config --libs) -L$(shell pkg-config --variable=plugindir purple) $(shell libgcrypt-config --libs)
CFLAGS=-std=c11 -Wall -g -Wstrict-overflow -D_XOPEN_SOURCE=700 -D_BSD_SOURCE $(PKGCFG_C) $(HEADERS)
LFLAGS=-pthread -ldl -lm $(PKGCFG_L) -ljabber
LFLAGS= -ldl -lm $(PKGCFG_L) -ljabber
all: $(BDIR)/lurch.so
......
......@@ -2169,6 +2169,10 @@ cleanup:
}
static void lurch_conv_created_cb(PurpleConversation * conv_p) {
if (strncmp(purple_account_get_protocol_id(purple_conversation_get_account(conv_p)), JABBER_PROTOCOL_ID, strlen(JABBER_PROTOCOL_ID))) {
return;
}
if (purple_conversation_get_type(conv_p) == 1) {
lurch_topic_update_im(conv_p);
} else if (purple_conversation_get_type(conv_p) == 2) {
......@@ -2177,6 +2181,10 @@ static void lurch_conv_created_cb(PurpleConversation * conv_p) {
}
static void lurch_conv_updated_cb(PurpleConversation * conv_p, PurpleConvUpdateType type) {
if (strncmp(purple_account_get_protocol_id(purple_conversation_get_account(conv_p)), JABBER_PROTOCOL_ID, strlen(JABBER_PROTOCOL_ID))) {
return;
}
if (type == 11) {
if (!topic_changed) {
topic_changed = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment