--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/attention.c Thu Feb 15 23:17:27 2018 -0500
@@ -0,0 +1,179 @@
+ * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +/****************************************************************************** + * PurpleAttentionType API + *****************************************************************************/ +struct _PurpleAttentionType { + const gchar *incoming_description; + const gchar *outgoing_description; + const gchar *icon_name; + const gchar *unlocalized_name; + purple_attention_type_copy, +purple_attention_type_new(const gchar *unlocalized_name, + const gchar *incoming_description, + const gchar *outgoing_description) + PurpleAttentionType *attn = g_new0(PurpleAttentionType, 1); + attn->unlocalized_name = unlocalized_name; + attn->incoming_description = incoming_description; + attn->outgoing_description = outgoing_description; +purple_attention_type_copy(PurpleAttentionType *attn) { + PurpleAttentionType *attn_copy = NULL; + g_return_val_if_fail(attn != NULL, NULL); + attn_copy = g_new(PurpleAttentionType, 1); +purple_attention_type_get_name(const PurpleAttentionType *type) { + g_return_val_if_fail(type, NULL); +purple_attention_type_set_name(PurpleAttentionType *type, const gchar *name) { + g_return_if_fail(type); +purple_attention_type_get_incoming_desc(const PurpleAttentionType *type) { + g_return_val_if_fail(type, NULL); + return type->incoming_description; +purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const gchar *desc) { + g_return_if_fail(type); + type->incoming_description = desc; +purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type) { + g_return_val_if_fail(type, NULL); + return type->outgoing_description; +purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const gchar *desc) { + g_return_if_fail(type != NULL); + type->outgoing_description = desc; +purple_attention_type_get_icon_name(const PurpleAttentionType *type) { + g_return_val_if_fail(type, NULL); + if(type->icon_name == NULL || *(type->icon_name) == '\0') + return type->icon_name; +purple_attention_type_set_icon_name(PurpleAttentionType *type, const gchar *name) { + g_return_if_fail(type); + type->icon_name = name; +purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type) { + g_return_val_if_fail(type, NULL); + return type->unlocalized_name; +purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const gchar *ulname) { + g_return_if_fail(type); + type->unlocalized_name = ulname; +/****************************************************************************** + * PurpleAttentionType API + *****************************************************************************/ +G_DEFINE_INTERFACE(PurpleProtocolAttention, purple_protocol_attention, G_TYPE_INVALID); +purple_protocol_attention_default_init(PurpleProtocolAttentionInterface *iface) { +purple_protocol_attention_send(PurpleProtocolAttention *attn, PurpleConnection *gc, const gchar *username, guint type) { + PurpleProtocolAttentionInterface *iface = NULL; + g_return_val_if_fail(PURPLE_IS_PROTOCOL_ATTENTION(attn), FALSE); + iface = PURPLE_PROTOCOL_ATTENTION_GET_IFACE(attn); + if(iface && iface->send) { + return iface->send(attn, gc, username, type); +purple_protocol_attention_get_types(PurpleProtocolAttention *attn, PurpleAccount *account) { + PurpleProtocolAttentionInterface *iface = NULL; + g_return_val_if_fail(PURPLE_IS_PROTOCOL_ATTENTION(attn), NULL); + iface = PURPLE_PROTOCOL_ATTENTION_GET_IFACE(attn); + if(iface && iface->get_types) { + return iface->get_types(attn, account); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/attention.h Thu Feb 15 23:17:27 2018 -0500
@@ -0,0 +1,254 @@
+ * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +#ifndef PURPLE_ATTENTION_H +#define PURPLE_ATTENTION_H +#include <glib-object.h> + * @section_id: libpurple-attention + * @short_description: <filename>attention.h</filename> + * @title: Attention Object and Interfaces +#define PURPLE_TYPE_ATTENTION_TYPE (purple_attention_type_get_type()) + * @name: The name to show in GUI elements. + * @incoming_description: Shown when received. + * @outgoing_description: Shown when sent. + * @icon_name: Optional name of the icon to display. + * @unlocalized_name: An unlocalized name for UIs that would rather use that. + * Represents "nudges" and "buzzes" that you may send to a buddy to attract + * their attention (or vice-versa). +typedef struct _PurpleAttentionType PurpleAttentionType; +#define PURPLE_TYPE_PROTOCOL_ATTENTION (purple_protocol_attention_get_type()) +#define PURPLE_PROTOCOL_ATTENTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_PROTOCOL_ATTENTION, PurpleProtocolAttention)) +#define PURPLE_IS_PROTOCOL_ATTENTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_ATTENTION)) +#define PURPLE_PROTOCOL_ATTENTION_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_ATTENTION, PurpleProtocolAttentionInterface)) +typedef struct _PurpleProtocolAttention PurpleProtocolAttention; +typedef struct _PurpleProtocolAttentionInterface PurpleProtocolAttentionInterface; + * PurpleProtocolAttentionInterface: + * The protocol attention interface. + * This interface provides attention API for sending and receiving + * zaps/nudges/buzzes etc. +struct _PurpleProtocolAttentionInterface + gboolean (*send)(PurpleProtocolAttention *attn, PurpleConnection *gc, const gchar *username, guint type); + GList *(*get_types)(PurpleProtocolAttention *attn, PurpleAccount *acct); +/****************************************************************************** + *****************************************************************************/ + * purple_attention_type_get_type: + * Returns: The #GType for the #PurpleAttentionType boxed structure. +GType purple_attention_type_get_type(void); +PurpleAttentionType *purple_attention_type_copy(PurpleAttentionType *attn); + * purple_attention_type_new: + * @unlocalized_name: A non-localized string that can be used by UIs in need of such + * non-localized strings. This should be the same as @name, + * without localization. + * @name: A localized string that the UI may display for the event. This + * should be the same string as @unlocalized_name, with localization. + * @incoming_description: A localized description shown when the event is received. + * @outgoing_description: A localized description shown when the event is sent. + * Creates a new #PurpleAttentionType object and sets its mandatory parameters. + * Returns: A pointer to the new object. +PurpleAttentionType *purple_attention_type_new(const gchar *unlocalized_name, const gchar *name, + const gchar *incoming_description, const gchar *outgoing_description); + * purple_attention_type_get_name: + * @type: The attention type. + * Get the attention type's name as displayed by the UI. +const gchar *purple_attention_type_get_name(const PurpleAttentionType *type); + * purple_attention_type_set_name: + * @type: The attention type. + * @name: The localized name that will be displayed by UIs. This should be + * the same string given as the unlocalized name, but with + * Sets the displayed name of the attention-demanding event. +void purple_attention_type_set_name(PurpleAttentionType *type, const gchar *name); + * purple_attention_type_get_incoming_desc: + * @type: The attention type. + * Get the attention type's description shown when the event is received. + * Returns: The description. +const gchar *purple_attention_type_get_incoming_desc(const PurpleAttentionType *type); + * purple_attention_type_set_incoming_desc: + * @type: The attention type. + * @desc: The localized description for incoming events. + * Sets the description of the attention-demanding event shown in conversations + * when the event is received. +void purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const gchar *desc); + * purple_attention_type_get_outgoing_desc: + * @type: The attention type. + * Get the attention type's description shown when the event is sent. + * Returns: The description. +const gchar *purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type); + * purple_attention_type_set_outgoing_desc: + * @type: The attention type. + * @desc: The localized description for outgoing events. + * Sets the description of the attention-demanding event shown in conversations + * when the event is sent. +void purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const gchar *desc); + * purple_attention_type_get_icon_name: + * @type: The attention type. + * Get the attention type's icon name. + * Note: Icons are optional for attention events. + * Returns: The icon name or %NULL if unset/empty. +const gchar *purple_attention_type_get_icon_name(const PurpleAttentionType *type); + * purple_attention_type_set_icon_name: + * @type: The attention type. + * @name: The icon's name. + * Sets the name of the icon to display for the attention event; this is optional. + * Note: Icons are optional for attention events. +void purple_attention_type_set_icon_name(PurpleAttentionType *type, const gchar *name); + * purple_attention_type_get_unlocalized_name: + * @type: The attention type + * Get the attention type's unlocalized name; this is useful for some UIs. + * Returns: The unlocalized name. +const gchar *purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type); + * purple_attention_type_set_unlocalized_name: + * @type: The attention type. + * @ulname: The unlocalized name. This should be the same string given as + * the localized name, but without localization. + * Sets the unlocalized name of the attention event; some UIs may need this, +void purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const gchar *ulname); +/****************************************************************************** + *****************************************************************************/ + * purple_protocol_attention_get_type: + * Returns: The #GType for the protocol attention interface. +GType purple_protocol_attention_get_type(void); + * purple_protocol_attention_get_types: + * @protocol: The #PurpleProtocol. + * @account: The #PurpleAccount whose attention types to get. + * Returns a list of #PurpleAttentionType's for @attn. + * Returns: (transfer container) (element-type PurpleAttentionType): The list of #PurpleAttentionType's. +GList *purple_protocol_attention_get_types(PurpleProtocolAttention *attn, PurpleAccount *acct); + * purple_protocol_attention_send: + * @attn: The #PurpleProtocolAttention instance. + * @gc: The #PurpleConnection to send on + * @username: The name of the user to send the attention to. + * @type: The type of attention to send. + * Sends an attention message of @type to @username. + * Returns: TRUE on success, FALSE otherwise. +gboolean purple_protocol_attention_send(PurpleProtocolAttention *attn, PurpleConnection *gc, const gchar *username, guint type); +#endif /* PURPLE_ATTENTION_H */ --- a/libpurple/meson.build Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/meson.build Thu Feb 15 23:17:27 2018 -0500
@@ -2,6 +2,7 @@
@@ -86,6 +87,7 @@
--- a/libpurple/protocol.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocol.c Thu Feb 15 23:17:27 2018 -0500
@@ -864,56 +864,6 @@
#undef DEFINE_PROTOCOL_FUNC
/**************************************************************************
- * Protocol Attention Interface API
- **************************************************************************/
-#define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
- PurpleProtocolAttentionIface *attention_iface = \
- PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \
- if (attention_iface && attention_iface->funcname) \
- attention_iface->funcname(__VA_ARGS__);
-#define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
- PurpleProtocolAttentionIface *attention_iface = \
- PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \
- if (attention_iface && attention_iface->funcname) \
- return attention_iface->funcname(__VA_ARGS__); \
-purple_protocol_attention_iface_get_type(void)
- if (G_UNLIKELY(type == 0)) {
- static const GTypeInfo info = {
- .class_size = sizeof(PurpleProtocolAttentionIface),
- type = g_type_register_static(G_TYPE_INTERFACE,
- "PurpleProtocolAttentionIface", &info, 0);
-purple_protocol_attention_iface_send(PurpleProtocol *protocol,
- PurpleConnection *gc, const char *username, guint type)
- DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, send, gc, username, type);
-purple_protocol_attention_iface_get_types(PurpleProtocol *protocol,
- PurpleAccount *account)
- DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_types, account);
-#undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
-#undef DEFINE_PROTOCOL_FUNC
-/**************************************************************************
* Protocol Media Interface API
**************************************************************************/
#define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
--- a/libpurple/protocol.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocol.h Thu Feb 15 23:17:27 2018 -0500
@@ -588,34 +588,6 @@
#define PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_ROOMLIST_IFACE, \
PurpleProtocolRoomlistIface))
-#define PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE (purple_protocol_attention_iface_get_type())
-typedef struct _PurpleProtocolAttentionIface PurpleProtocolAttentionIface;
- * PurpleProtocolAttentionIface:
- * The protocol attention interface.
- * This interface provides attention API for sending and receiving
- * zaps/nudges/buzzes etc.
-struct _PurpleProtocolAttentionIface
- GTypeInterface parent_iface;
- gboolean (*send)(PurpleConnection *gc, const char *username,
- GList *(*get_types)(PurpleAccount *acct);
-#define PURPLE_PROTOCOL_HAS_ATTENTION_IFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE))
-#define PURPLE_PROTOCOL_GET_ATTENTION_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE, \
- PurpleProtocolAttentionIface))
#define PURPLE_TYPE_PROTOCOL_MEDIA_IFACE (purple_protocol_media_iface_get_type())
typedef struct _PurpleProtocolMediaIface PurpleProtocolMediaIface;
@@ -1078,23 +1050,6 @@
PurpleRoomlistRoom *room);
/**************************************************************************/
-/* Protocol Attention Interface API */
-/**************************************************************************/
- * purple_protocol_attention_iface_get_type:
- * Returns: The #GType for the protocol attention interface.
-GType purple_protocol_attention_iface_get_type(void);
-gboolean purple_protocol_attention_iface_send(PurpleProtocol *protocol,
- PurpleConnection *gc, const char *username, guint type);
-GList *purple_protocol_attention_iface_get_types(PurpleProtocol *protocol,
-/**************************************************************************/
/* Protocol Media Interface API */
/**************************************************************************/
--- a/libpurple/protocols.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols.c Thu Feb 15 23:17:27 2018 -0500
@@ -32,149 +32,6 @@
static GHashTable *protocols = NULL;
-/**************************************************************************/
-/* Attention Type API */
-/**************************************************************************/
-struct _PurpleAttentionType
- const char *name; /* Shown in GUI elements */
- const char *incoming_description; /* Shown when sent */
- const char *outgoing_description; /* Shown when receied */
- const char *icon_name; /* Icon to display (optional) */
- const char *unlocalized_name; /* Unlocalized name for UIs needing it */
-purple_attention_type_new(const char *ulname, const char *name,
- const char *inc_desc, const char *out_desc)
- PurpleAttentionType *attn = g_new0(PurpleAttentionType, 1);
- purple_attention_type_set_name(attn, name);
- purple_attention_type_set_incoming_desc(attn, inc_desc);
- purple_attention_type_set_outgoing_desc(attn, out_desc);
- purple_attention_type_set_unlocalized_name(attn, ulname);
-purple_attention_type_set_name(PurpleAttentionType *type, const char *name)
- g_return_if_fail(type != NULL);
-purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const char *desc)
- g_return_if_fail(type != NULL);
- type->incoming_description = desc;
-purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const char *desc)
- g_return_if_fail(type != NULL);
- type->outgoing_description = desc;
-purple_attention_type_set_icon_name(PurpleAttentionType *type, const char *name)
- g_return_if_fail(type != NULL);
- type->icon_name = name;
-purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const char *ulname)
- g_return_if_fail(type != NULL);
- type->unlocalized_name = ulname;
-purple_attention_type_get_name(const PurpleAttentionType *type)
- g_return_val_if_fail(type != NULL, NULL);
-purple_attention_type_get_incoming_desc(const PurpleAttentionType *type)
- g_return_val_if_fail(type != NULL, NULL);
- return type->incoming_description;
-purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type)
- g_return_val_if_fail(type != NULL, NULL);
- return type->outgoing_description;
-purple_attention_type_get_icon_name(const PurpleAttentionType *type)
- g_return_val_if_fail(type != NULL, NULL);
- if(type->icon_name == NULL || *(type->icon_name) == '\0')
- return type->icon_name;
-purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type)
- g_return_val_if_fail(type != NULL, NULL);
- return type->unlocalized_name;
-/**************************************************************************
- * GBoxed code for PurpleAttentionType
- **************************************************************************/
-static PurpleAttentionType *
-purple_attention_type_copy(PurpleAttentionType *attn)
- PurpleAttentionType *attn_copy;
- g_return_val_if_fail(attn != NULL, NULL);
- attn_copy = g_new(PurpleAttentionType, 1);
-purple_attention_type_get_type(void)
- type = g_boxed_type_register_static("PurpleAttentionType",
- (GBoxedCopyFunc)purple_attention_type_copy,
- (GBoxedFreeFunc)g_free);
/**************************************************************************
* GBoxed code for PurpleProtocolChatEntry
**************************************************************************/
@@ -508,7 +365,7 @@
g_return_if_fail(who != NULL);
protocol = purple_protocols_find(purple_account_get_protocol_id(purple_connection_get_account(gc)));
- g_return_if_fail(PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, send));
+ g_return_if_fail(PURPLE_IS_PROTOCOL_ATTENTION(protocol)); attn = purple_get_attention_type_from_code(purple_connection_get_account(gc), type_code);
@@ -526,7 +383,7 @@
purple_debug_info("server", "serv_send_attention: sending '%s' to %s\n",
- if (!purple_protocol_attention_iface_send(protocol, gc, who, type_code))
+ if (!purple_protocol_attention_send(PURPLE_PROTOCOL_ATTENTION(protocol), gc, who, type_code)) im = purple_im_conversation_new(purple_connection_get_account(gc), who);
--- a/libpurple/protocols.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols.h Thu Feb 15 23:17:27 2018 -0500
@@ -36,16 +36,6 @@
typedef struct _PurpleProtocolAction PurpleProtocolAction;
typedef void (*PurpleProtocolActionCallback)(PurpleProtocolAction *action);
-#define PURPLE_TYPE_ATTENTION_TYPE (purple_attention_type_get_type())
- * Represents "nudges" and "buzzes" that you may send to a buddy to attract
- * their attention (or vice-versa).
-typedef struct _PurpleAttentionType PurpleAttentionType;
/**************************************************************************/
/* Basic Protocol Information */
/**************************************************************************/
@@ -157,135 +147,6 @@
/**************************************************************************/
- * purple_attention_type_get_type:
- * Returns: The #GType for the #PurpleAttentionType boxed structure.
-GType purple_attention_type_get_type(void);
- * purple_attention_type_new:
- * @ulname: A non-localized string that can be used by UIs in need of such
- * non-localized strings. This should be the same as @name,
- * without localization.
- * @name: A localized string that the UI may display for the event. This
- * should be the same string as @ulname, with localization.
- * @inc_desc: A localized description shown when the event is received.
- * @out_desc: A localized description shown when the event is sent.
- * Creates a new #PurpleAttentionType object and sets its mandatory parameters.
- * Returns: A pointer to the new object.
-PurpleAttentionType *purple_attention_type_new(const char *ulname, const char *name,
- const char *inc_desc, const char *out_desc);
- * purple_attention_type_set_name:
- * @type: The attention type.
- * @name: The localized name that will be displayed by UIs. This should be
- * the same string given as the unlocalized name, but with
- * Sets the displayed name of the attention-demanding event.
-void purple_attention_type_set_name(PurpleAttentionType *type, const char *name);
- * purple_attention_type_set_incoming_desc:
- * @type: The attention type.
- * @desc: The localized description for incoming events.
- * Sets the description of the attention-demanding event shown in conversations
- * when the event is received.
-void purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const char *desc);
- * purple_attention_type_set_outgoing_desc:
- * @type: The attention type.
- * @desc: The localized description for outgoing events.
- * Sets the description of the attention-demanding event shown in conversations
- * when the event is sent.
-void purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const char *desc);
- * purple_attention_type_set_icon_name:
- * @type: The attention type.
- * @name: The icon's name.
- * Sets the name of the icon to display for the attention event; this is optional.
- * Note: Icons are optional for attention events.
-void purple_attention_type_set_icon_name(PurpleAttentionType *type, const char *name);
- * purple_attention_type_set_unlocalized_name:
- * @type: The attention type.
- * @ulname: The unlocalized name. This should be the same string given as
- * the localized name, but without localization.
- * Sets the unlocalized name of the attention event; some UIs may need this,
-void purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const char *ulname);
- * purple_attention_type_get_name:
- * @type: The attention type.
- * Get the attention type's name as displayed by the UI.
-const char *purple_attention_type_get_name(const PurpleAttentionType *type);
- * purple_attention_type_get_incoming_desc:
- * @type: The attention type.
- * Get the attention type's description shown when the event is received.
- * Returns: The description.
-const char *purple_attention_type_get_incoming_desc(const PurpleAttentionType *type);
- * purple_attention_type_get_outgoing_desc:
- * @type: The attention type.
- * Get the attention type's description shown when the event is sent.
- * Returns: The description.
-const char *purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type);
- * purple_attention_type_get_icon_name:
- * @type: The attention type.
- * Get the attention type's icon name.
- * Note: Icons are optional for attention events.
- * Returns: The icon name or %NULL if unset/empty.
-const char *purple_attention_type_get_icon_name(const PurpleAttentionType *type);
- * purple_attention_type_get_unlocalized_name:
- * @type: The attention type
- * Get the attention type's unlocalized name; this is useful for some UIs.
- * Returns: The unlocalized name.
-const char *purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type);
/**************************************************************************/
/* Protocol Action API */
/**************************************************************************/
--- a/libpurple/protocols/bonjour/jabber.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/bonjour/jabber.c Thu Feb 15 23:17:27 2018 -0500
@@ -158,10 +158,6 @@
events_node = purple_xmlnode_get_child_with_namespace(message_node, "x", "jabber:x:event");
if (events_node != NULL) {
- if (purple_xmlnode_get_child(events_node, "composing") != NULL)
- composing_event = TRUE;
if (purple_xmlnode_get_child(events_node, "id") != NULL) {
/* The user is just typing */
/* TODO: Deal with typing notification */
@@ -393,17 +389,7 @@
bb = purple_buddy_get_protocol_data(bconv->pb);
- if(bconv->pb != NULL) {
- PurpleConversation *conv;
- conv = purple_conversations_find_im_with_account(bconv->pb->name, bconv->pb->account);
- char *tmp = g_strdup_printf(_("%s has closed the conversation."), bconv->pb->name);
- purple_conversation_write_system_message(conv, tmp, 0);
/* Close the socket, clear the watcher and free memory */
bonjour_jabber_close_conversation(bconv);
@@ -737,16 +723,6 @@
- /* TODO: Why isn't this being used? */
- data->socket = purple_network_listen(jdata->port, AF_UNSPEC, SOCK_STREAM, TRUE);
- if (jdata->socket == -1)
- purple_debug_error("bonjour", "No se ha podido crear el socket\n");
--- a/libpurple/protocols/gg/account.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/gg/account.c Thu Feb 15 23:17:27 2018 -0500
@@ -149,10 +149,6 @@
ggp_account_token *token, gpointer _register_data);
static void ggp_account_register_dialog_ok(
ggp_account_register_data *register_data, PurpleRequestFields *fields);
-static void ggp_account_register_dialog_invalid(
- ggp_account_register_data *register_data, const gchar *message);
static void ggp_account_register_dialog_cancel(
ggp_account_register_data *register_data, PurpleRequestFields *fields);
static void ggp_account_register_response(struct gg_http *h, gboolean success,
@@ -295,20 +291,6 @@
ggp_account_register_response, register_data, TRUE);
-/* libgadu 1.12.x: use it for invalid token */
-static void ggp_account_register_dialog_invalid(
- ggp_account_register_data *register_data, const gchar *message)
- purple_debug_warning("gg", "ggp_account_register_dialog_invalid: %s\n",
- ggp_account_register_dialog(register_data->gc, register_data->token,
- purple_notify_error(purple_connection_get_account(register_data->gc),
- GGP_ACCOUNT_REGISTER_TITLE, message, NULL);
static void ggp_account_register_response(struct gg_http *h, gboolean success,
gboolean cancelled, gpointer _register_data)
--- a/libpurple/protocols/gg/validator.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/gg/validator.c Thu Feb 15 23:17:27 2018 -0500
@@ -31,29 +31,6 @@
-gboolean ggp_validator_token(PurpleRequestField *field, gchar **errmsg,
- g_return_val_if_fail(field != NULL, FALSE);
- g_return_val_if_fail(purple_request_field_get_field_type(field) ==
- PURPLE_REQUEST_FIELD_STRING, FALSE);
- value = purple_request_field_string_get_value(field);
- if (value != NULL && ggp_account_token_validate(token, value))
- *errmsg = g_strdup(_("CAPTCHA validation failed"));
gboolean ggp_validator_password(PurpleRequestField *field, gchar **errmsg,
--- a/libpurple/protocols/gg/validator.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/gg/validator.h Thu Feb 15 23:17:27 2018 -0500
@@ -33,12 +33,6 @@
-gboolean ggp_validator_token(PurpleRequestField *field, gchar **errmsg,
gboolean ggp_validator_password(PurpleRequestField *field, gchar **errmsg,
--- a/libpurple/protocols/irc/irc.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/irc/irc.c Thu Feb 15 23:17:27 2018 -0500
@@ -687,11 +687,6 @@
purple_debug(PURPLE_DEBUG_ERROR, "irc", "chat send on nonexistent chat\n");
- return irc_parse_cmd(irc, convo->name, what + 1);
purple_markup_html_to_xhtml(purple_message_get_contents(msg), NULL, &tmp);
args[0] = purple_conversation_get_name(convo);
--- a/libpurple/protocols/jabber/auth_scram.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/auth_scram.c Thu Feb 15 23:17:27 2018 -0500
@@ -46,35 +46,6 @@
g_return_val_if_reached(NULL);
-/* XXX: this code is not (yet) used */
- N_("Invalid Encoding")},
- { "extensions-not-supported",
- N_("Unsupported Extension") },
- { "channel-bindings-dont-match",
- N_("Unexpected response from the server. This may indicate a possible MITM attack") },
- { "server-does-support-channel-binding",
- N_("The server does support channel binding, but did not appear to advertise it. This indicates a likely MITM attack") },
- { "channel-binding-not-supported",
- N_("Server does not support channel binding") },
- { "unsupported-channel-binding-type",
- N_("Unsupported channel binding method") },
- N_("User not found") },
- { "invalid-username-encoding",
- N_("Invalid Username Encoding") },
- N_("Resource Constraint") },
guchar *jabber_scram_hi(const JabberScramHash *hash, const GString *str,
GString *salt, guint iterations)
--- a/libpurple/protocols/jabber/buddy.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/buddy.c Thu Feb 15 23:17:27 2018 -0500
@@ -2135,24 +2135,6 @@
-/* This is for gettext only -- it will see this even though there's an #if 0. */
- * An incomplete list of server generated original language search
- * comments for Jabber User Directories
- * See discussion thread "Search comment for Jabber is not translatable"
- * in purple-i18n@lists.sourceforge.net (March 2006)
-static const char * jabber_user_dir_comments [] = {
- /* current comment from Jabber User Directory users.jabber.org */
- N_("Find a contact by entering the search criteria in the given fields. "
- "Note: Each field supports wild card searches (%)"),
static void user_search_fields_result_cb(JabberStream *js, const char *from,
JabberIqType type, const char *id,
PurpleXmlNode *packet, gpointer data)
--- a/libpurple/protocols/jabber/chat.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/chat.c Thu Feb 15 23:17:27 2018 -0500
@@ -1214,9 +1214,6 @@
PurpleXmlNode *packet, gpointer data)
- PurpleXmlNode *query, *x;
int chat_id = GPOINTER_TO_INT(data);
if(!(chat = jabber_chat_find_by_id(js, chat_id)))
@@ -1225,27 +1222,6 @@
/* defaults, in case the conference server doesn't
* support this request */
- /* disabling this until more MUC servers support
- if (type == JABBER_IQ_ERROR) {
- if(!(query = purple_xmlnode_get_child(packet, "query")))
- for(x = purple_xmlnode_get_child(query, "feature"); x; x = purple_xmlnode_get_next_twin(x)) {
- const char *var = purple_xmlnode_get_attrib(x, "var");
- if(purple_strequal(var, NS_XHTML_IM)) {
void jabber_chat_disco_traffic(JabberChat *chat)
--- a/libpurple/protocols/jabber/gtalk.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/gtalk.c Thu Feb 15 23:17:27 2018 -0500
@@ -62,9 +62,6 @@
ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
ADD_VALUE(encryption_values, _("Use old-style SSL"), "old_ssl");
- ADD_VALUE(encryption_values, "None", "none");
encryption_values = g_list_reverse(encryption_values);
--- a/libpurple/protocols/jabber/jabber.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/jabber.c Thu Feb 15 23:17:27 2018 -0500
@@ -220,50 +220,9 @@
jabber_process_starttls(JabberStream *js, PurpleXmlNode *packet)
- PurpleXmlNode *starttls;
- PurpleAccount *account;
- account = purple_connection_get_account(js->gc);
- * This code DOES NOT EXIST, will never be enabled by default, and
- * will never ever be supported (by me).
- * It's literally *only* for developer testing.
- const gchar *connection_security = purple_account_get_string(account, "connection_security", JABBER_DEFAULT_REQUIRE_TLS);
- if (!purple_strequal(connection_security, "none")) {
- "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
- starttls = purple_xmlnode_get_child(packet, "starttls");
- if(purple_xmlnode_get_child(starttls, "required")) {
- purple_connection_error(js->gc,
- PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
- _("Server requires TLS/SSL, but no TLS/SSL support was found."));
- if (purple_strequal("require_tls", purple_account_get_string(account, "connection_security", JABBER_DEFAULT_REQUIRE_TLS))) {
- purple_connection_error(js->gc,
- PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
- _("You require encryption, but no TLS/SSL support was found."));
void jabber_stream_features_parse(JabberStream *js, PurpleXmlNode *packet)
@@ -2688,9 +2647,7 @@
PurpleXmlNode *t = purple_xmlnode_get_child_with_namespace(error, "text", NS_XMPP_STANZAS);
cdata = purple_xmlnode_get_data(t);
- cdata = purple_xmlnode_get_data(error);
code = purple_xmlnode_get_attrib(error, "code");
@@ -3211,7 +3168,7 @@
return _jabber_send_buzz(js, who, error) ? PURPLE_CMD_RET_OK : PURPLE_CMD_RET_FAILED;
-GList *jabber_attention_types(PurpleAccount *account)
+GList *jabber_attention_types(PurpleProtocolAttention *attn, PurpleAccount *account) static GList *types = NULL;
@@ -3223,7 +3180,7 @@
-gboolean jabber_send_attention(PurpleConnection *gc, const char *username, guint code)
+gboolean jabber_send_attention(PurpleProtocolAttention *attn, PurpleConnection *gc, const char *username, guint code) JabberStream *js = purple_connection_get_protocol_data(gc);
@@ -3762,56 +3719,6 @@
g_hash_table_remove(jabber_cmds, protocol);
- * IPC function for determining if a contact supports a certain feature.
- * @param account The PurpleAccount
- * @param jid The full JID of the contact.
- * @param feature The feature's namespace.
- * @return TRUE if supports feature; else FALSE.
-jabber_ipc_contact_has_feature(PurpleAccount *account, const gchar *jid,
- PurpleConnection *gc = purple_account_get_connection(account);
- JabberBuddyResource *jbr;
- if (!purple_account_is_connected(account))
- js = purple_connection_get_protocol_data(gc);
- if (!(resource = jabber_get_resource(jid)) ||
- !(jb = jabber_buddy_find(js, jid, FALSE)) ||
- !(jbr = jabber_buddy_find_resource(jb, resource))) {
- return jabber_resource_has_capability(jbr, feature);
-jabber_ipc_add_feature(const gchar *feature)
- jabber_add_feature(feature, 0);
- /* send presence with new caps info for all connected accounts */
- jabber_caps_broadcast_change();
static PurpleAccount *find_acct(const char *protocol, const char *acct_id)
PurpleAccount *acct = NULL;
@@ -4032,32 +3939,6 @@
jabber_register_commands(protocol);
- purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature),
- purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
- PURPLE_TYPE_ACCOUNT, G_TYPE_STRING, G_TYPE_STRING);
- purple_plugin_ipc_register(plugin, "add_feature", PURPLE_CALLBACK(jabber_ipc_add_feature),
- purple_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_STRING);
- purple_plugin_ipc_register(plugin, "register_namespace_watcher",
- PURPLE_CALLBACK(jabber_iq_signal_register),
- purple_marshal_VOID__POINTER_POINTER,
- G_TYPE_STRING, /* node */
- G_TYPE_STRING); /* namespace */
- purple_plugin_ipc_register(plugin, "unregister_namespace_watcher",
- PURPLE_CALLBACK(jabber_iq_signal_unregister),
- purple_marshal_VOID__POINTER_POINTER,
- G_TYPE_STRING, /* node */
- G_TYPE_STRING); /* namespace */
purple_signal_register(protocol, "jabber-register-namespace-watcher",
purple_marshal_VOID__POINTER_POINTER,
@@ -4141,9 +4022,6 @@
g_return_if_fail(plugin_ref > 0);
purple_signals_unregister_by_instance(protocol);
- purple_plugin_ipc_unregister_all(plugin);
jabber_unregister_commands(protocol);
@@ -4249,10 +4127,10 @@
-jabber_protocol_attention_iface_init(PurpleProtocolAttentionIface *attention_iface)
+jabber_protocol_attention_iface_init(PurpleProtocolAttentionInterface *iface) - attention_iface->send = jabber_send_attention;
- attention_iface->get_types = jabber_attention_types;
+ iface->send = jabber_send_attention; + iface->get_types = jabber_attention_types; @@ -4291,7 +4169,7 @@
PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ROOMLIST_IFACE,
jabber_protocol_roomlist_iface_init)
- PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE,
+ PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ATTENTION, jabber_protocol_attention_iface_init)
PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_MEDIA_IFACE,
--- a/libpurple/protocols/jabber/jabber.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/jabber.h Thu Feb 15 23:17:27 2018 -0500
@@ -59,6 +59,7 @@
#include "circularbuffer.h"
@@ -418,8 +419,8 @@
void jabber_register_gateway(JabberStream *js, const char *gateway);
void jabber_register_account(PurpleAccount *account);
void jabber_unregister_account(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
-gboolean jabber_send_attention(PurpleConnection *gc, const char *username, guint code);
-GList *jabber_attention_types(PurpleAccount *account);
+gboolean jabber_send_attention(PurpleProtocolAttention *attn, PurpleConnection *gc, const char *username, guint code); +GList *jabber_attention_types(PurpleProtocolAttention *attn, PurpleAccount *account); void jabber_convo_closed(PurpleConnection *gc, const char *who);
PurpleChat *jabber_find_blist_chat(PurpleAccount *account, const char *name);
gboolean jabber_offline_message(const PurpleBuddy *buddy);
--- a/libpurple/protocols/jabber/jingle/jingle.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/jingle/jingle.c Thu Feb 15 23:17:27 2018 -0500
@@ -51,24 +51,12 @@
return JINGLE_TYPE_RAWUDP;
else if (purple_strequal(type, JINGLE_TRANSPORT_ICEUDP))
return JINGLE_TYPE_ICEUDP;
- else if (purple_strequal(type, JINGLE_TRANSPORT_SOCKS))
- return JINGLE_TYPE_SOCKS;
- else if (purple_strequal(type, JINGLE_TRANSPORT_IBB))
- return JINGLE_TYPE_IBB;
else if (purple_strequal(type, JINGLE_APP_RTP))
else if (!strcmp(type, NS_GOOGLE_TRANSPORT_P2P))
return JINGLE_TYPE_GOOGLE_P2P;
- else if (purple_strequal(type, JINGLE_APP_FT))
- else if (purple_strequal(type, JINGLE_APP_XML))
- return JINGLE_TYPE_XML;
--- a/libpurple/protocols/jabber/jingle/rtp.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/jingle/rtp.c Thu Feb 15 23:17:27 2018 -0500
@@ -59,13 +59,6 @@
static PurpleMedia *jingle_rtp_get_media(JingleSession *session);
-static guint jingle_rtp_signals[LAST_SIGNAL] = {0};
--- a/libpurple/protocols/jabber/jutil.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/jutil.c Thu Feb 15 23:17:27 2018 -0500
@@ -322,9 +322,6 @@
const char *slash = NULL;
gboolean needs_validation = FALSE;
- gboolean node_is_required = FALSE;
@@ -378,28 +375,6 @@
- /* characters allowed only in the resource */
- /* characters allowed only in the node */
- * Ok, this character is valid, but only if it's a part
- * of the node and not the domain. But we don't know
- * if "c" is a part of the node or the domain until after
- * we've found the @. So set a flag for now and check
- * that we found an @ later.
- node_is_required = TRUE;
* Hmm, this character is a bit more exotic. Better fall
* back to using the more expensive UTF-8 compliant
@@ -410,12 +385,6 @@
- if (node_is_required && at == NULL)
- /* Found invalid characters in the domain */
/* JID is made of only ASCII characters--just lowercase and return */
jid = g_new0(JabberID, 1);
--- a/libpurple/protocols/jabber/parser.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/parser.c Thu Feb 15 23:17:27 2018 -0500
@@ -94,23 +94,14 @@
if (js->stream_id == NULL) {
- /* This was underspecified in rfc3920 as only being a SHOULD, so
- * we cannot rely on it. See #12331 and Oracle's server.
- purple_connection_error(js->gc,
- PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
- _("XMPP stream missing ID"));
- /* Instead, let's make up a placeholder stream ID, which we need
- * to do because we flag on it being NULL as a special case
- * in this parsing code.
+ /* Let's make up a placeholder stream ID, which we need to do + * because we flag on it being NULL as a special case in this js->stream_id = g_strdup("");
purple_debug_info("jabber", "Server failed to specify a stream "
"ID (underspecified in rfc3920, but intended "
"to be a MUST; digest legacy auth may fail.\n");
--- a/libpurple/protocols/jabber/presence.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/presence.c Thu Feb 15 23:17:27 2018 -0500
@@ -525,18 +525,6 @@
jbr->commands_fetched = TRUE;
- * Versions of libpurple before 2.6.0 didn't advertise this capability, so
- * we can't yet use Entity Capabilities to determine whether or not the
- * other client supports Chat States.
- if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/chatstates"))
- jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
- jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
--- a/libpurple/protocols/jabber/roster.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/roster.c Thu Feb 15 23:17:27 2018 -0500
@@ -203,9 +203,6 @@
JabberIqType type, const char *id, PurpleXmlNode *query)
PurpleXmlNode *item, *group;
if (!jabber_is_own_account(js, from)) {
purple_debug_warning("jabber", "Received bogon roster push from %s\n",
@@ -285,14 +282,6 @@
- ver = purple_xmlnode_get_attrib(query, "ver");
- PurpleAccount *account = purple_connection_get_account(js->gc);
- purple_account_set_string(account, "roster_ver", ver);
if (type == JABBER_IQ_SET) {
JabberIq *ack = jabber_iq_new(js, JABBER_IQ_RESULT);
jabber_iq_set_id(ack, id);
--- a/libpurple/protocols/jabber/tests/test_jabber_scram.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/tests/test_jabber_scram.c Thu Feb 15 23:17:27 2018 -0500
@@ -22,11 +22,10 @@
assert_pbkdf2_equal("password", "salt", 1, "\x0c\x60\xc8\x0f\x96\x1f\x0e\x71\xf3\xa9\xb5\x24\xaf\x60\x12\x06\x2f\xe0\x37\xa6");
assert_pbkdf2_equal("password", "salt", 2, "\xea\x6c\x01\x4d\xc7\x2d\x6f\x8c\xcd\x1e\xd9\x2a\xce\x1d\x41\xf0\xd8\xde\x89\x57");
assert_pbkdf2_equal("password", "salt", 4096, "\x4b\x00\x79\x01\xb7\x65\x48\x9a\xbe\xad\x49\xd9\x26\xf7\x21\xd0\x65\xa4\x29\xc1");
- /* This causes libcheck to time out :-D */
+ /* This test is insane and takes forever, so it's disabled */ assert_pbkdf2_equal("password", "salt", 16777216, "\xee\xfe\x3d\x61\xcd\x4d\xa4\xe4\xe9\x94\x5b\x3d\x6b\xa2\x15\x8c\x26\x34\xe9\x84");
--- a/libpurple/protocols/jabber/useravatar.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/useravatar.c Thu Feb 15 23:17:27 2018 -0500
@@ -46,27 +46,6 @@
remove_avatar_0_12_nodes(JabberStream *js)
- /* See note below for why this is #if 0'd */
- /* Publish an empty avatar according to the XEP-0084 v0.12 semantics */
- PurpleXmlNode *publish, *item, *metadata;
- /* publish the metadata */
- publish = purple_xmlnode_new("publish");
- purple_xmlnode_set_attrib(publish, "node", NS_AVATAR_0_12_METADATA);
- item = purple_xmlnode_new_child(publish, "item");
- purple_xmlnode_set_attrib(item, "id", "stop");
- metadata = purple_xmlnode_new_child(item, "metadata");
- purple_xmlnode_set_namespace(metadata, NS_AVATAR_0_12_METADATA);
- purple_xmlnode_new_child(metadata, "stop");
- jabber_pep_publish(js, publish);
* This causes ejabberd 2.0.0 to kill the connection unceremoniously.
* See https://support.process-one.net/browse/EJAB-623. When adiumx.com
--- a/libpurple/protocols/jabber/xmpp.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/jabber/xmpp.c Thu Feb 15 23:17:27 2018 -0500
@@ -53,9 +53,6 @@
ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
ADD_VALUE(encryption_values, _("Use old-style SSL"), "old_ssl");
- ADD_VALUE(encryption_values, "None", "none");
encryption_values = g_list_reverse(encryption_values);
--- a/libpurple/protocols/novell/novell.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/novell/novell.c Thu Feb 15 23:17:27 2018 -0500
@@ -1533,20 +1533,6 @@
purple_notify_user_info_add_pair_html(user_info, tag, value);
- /* Hint for translators: "DN" here refers to a piece of information about
- a user on the Novell protocol. "DN" is not an English word. I think
- it's an abbreviation, possibly for "distinguished name" as defined in
- the X.500 standard. It's probably fine to leave it untranslated. */
- value = nm_user_record_get_dn(user_record);
- /* TODO: Check whether it's correct to call add_pair_html,
- or if we should be using add_pair_plaintext */
- purple_notify_user_info_add_pair_html(user_info, tag, value);
value = nm_user_record_get_full_name(user_record);
--- a/libpurple/protocols/sametime/sametime.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/sametime/sametime.c Thu Feb 15 23:17:27 2018 -0500
@@ -426,11 +426,6 @@
@@ -1353,18 +1348,6 @@
/* better make sure we're connected */
if(! purple_account_is_connected(acct)) return;
- /* if there's anyone in the group for this acct, offer to invite
- them all to a conference */
- group = (PurpleGroup *) node;
- if(purple_group_on_account(group, acct)) {
- act = purple_menu_action_new(_("Invite Group to Conference..."),
- PURPLE_CALLBACK(blist_menu_group_invite),
- *menu = g_list_append(*menu, NULL);
/* check if it's a NAB group for this account */
owner = purple_blist_node_get_string(node, GROUP_KEY_OWNER);
if(owner && purple_strequal(owner, purple_account_get_username(acct))) {
@@ -2626,13 +2609,6 @@
- /* don't do this, to prevent the occasional weird sending of
- formatted messages as plaintext when the other end closes the
- conversation after we've begun composing the message */
- convo_nofeatures(conv);
mwConversation_removeClientData(conv);
@@ -3559,42 +3535,6 @@
-static void blist_menu_announce(PurpleBlistNode *node, gpointer data) {
- PurpleBuddy *buddy = (PurpleBuddy *) node;
- struct mwPurpleProtocolData *pd;
- struct mwSession *session;
- g_return_if_fail(node != NULL);
- g_return_if_fail(PURPLE_IS_BUDDY(node));
- g_return_if_fail(acct != NULL);
- gc = purple_account_get_connection(acct);
- g_return_if_fail(gc != NULL);
- pd = purple_connection_get_protocol_data(gc);
- g_return_if_fail(pd != NULL);
- rcpt_name = g_strdup_printf("@U %s", buddy->name);
- rcpt = g_list_prepend(NULL, rcpt_name);
- mwSession_sendAnnounce(session, FALSE,
- "This is a TEST announcement. Please ignore.",
static GList *mw_protocol_blist_node_menu(PurpleBlistNode *node) {
@@ -3608,12 +3548,6 @@
PURPLE_CALLBACK(blist_menu_conf), NULL, NULL);
l = g_list_append(l, act);
- act = purple_menu_action_new(_("Send TEST Announcement"),
- PURPLE_CALLBACK(blist_menu_announce), NULL, NULL);
- l = g_list_append(l, act);
/** note: this never gets called for a PurpleGroup, have to use the
blist-node-extended-menu signal for that. The function
blist_node_menu_cb is assigned to this signal in the function
@@ -4390,40 +4324,6 @@
- /* fall-through indicates that we couldn't find a matching user in
- the resolve service (ether error or zero results), so we remove
- /* note: I can't really think of a good reason to alter the buddy
- list in any way. There has been at least one report where the
- resolve service isn't returning correct results anyway, so let's
- just leave them in the list. I'm just going to if0 this section
- out unless I can think of a very good reason to do this. -siege */
- DEBUG_INFO("no such buddy in community\n");
- purple_blist_remove_buddy(buddy);
- /* compose and display an error message */
- msgA = _("Unable to add user: user not found");
- msgB = _("The identifier '%s' did not match any users in your"
- " Sametime community. This entry has been removed from"
- msg = g_strdup_printf(msgB, NSTR(res->name));
- purple_notify_error(gc, _("Unable to add user"), msgA, msg);
@@ -5063,36 +4963,6 @@
-static PurplePluginPrefFrame *
-mw_plugin_get_plugin_pref_frame(PurplePlugin *plugin) {
- PurplePluginPrefFrame *frame;
- PurplePluginPref *pref;
- frame = purple_plugin_pref_frame_new();
- pref = purple_plugin_pref_new_with_label(_("Remotely Stored Buddy List"));
- purple_plugin_pref_frame_add(frame, pref);
- pref = purple_plugin_pref_new_with_name(MW_PROTOCOL_OPT_BLIST_ACTION);
- purple_plugin_pref_set_label(pref, _("Buddy List Storage Mode"));
- purple_plugin_pref_set_pref_type(pref, PURPLE_PLUGIN_PREF_CHOICE);
- purple_plugin_pref_add_choice(pref, _("Local Buddy List Only"),
- GINT_TO_POINTER(blist_choice_LOCAL));
- purple_plugin_pref_add_choice(pref, _("Merge List from Server"),
- GINT_TO_POINTER(blist_choice_MERGE));
- purple_plugin_pref_add_choice(pref, _("Merge and Save List to Server"),
- GINT_TO_POINTER(blist_choice_STORE));
- purple_plugin_pref_add_choice(pref, _("Synchronize List with Server"),
- GINT_TO_POINTER(blist_choice_SYNCH));
- purple_plugin_pref_frame_add(frame, pref);
static void st_import_action_cb(PurpleConnection *gc, char *filename) {
struct mwSametimeList *l;
--- a/libpurple/protocols/silc/chat.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/silc/chat.c Thu Feb 15 23:17:27 2018 -0500
@@ -192,27 +192,6 @@
-#if 0 /* XXX For now these are not implemented. We need better
- listview dialog from Purple for these. */
-/************************** Channel Invite List ******************************/
-silcpurple_chat_invitelist(PurpleBlistNode *node, gpointer data);
-/**************************** Channel Ban List *******************************/
-silcpurple_chat_banlist(PurpleBlistNode *node, gpointer data);
/************************* Channel Authentication ****************************/
@@ -915,21 +894,6 @@
m = g_list_append(m, act);
-#if 0 /* XXX For now these are not implemented. We need better
- listview dialog from Purple for these. */
- if (mode & SILC_CHANNEL_UMODE_CHANOP) {
- act = purple_menu_action_new(_("Invite List"),
- PURPLE_CALLBACK(silcpurple_chat_invitelist),
- m = g_list_append(m, act);
- act = purple_menu_action_new(_("Ban List"),
- PURPLE_CALLBACK(silcpurple_chat_banlist),
- m = g_list_append(m, act);
act = purple_menu_action_new(_("Add Private Group"),
PURPLE_CALLBACK(silcpurple_chat_prv),
--- a/libpurple/protocols/silc/ops.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/silc/ops.c Thu Feb 15 23:17:27 2018 -0500
@@ -967,107 +967,6 @@
-silcpurple_whois_more(SilcClientEntry client_entry, gint id)
- SilcAttributePayload attr;
- SilcAttribute attribute;
- memset(&vcard, 0, sizeof(vcard));
- silc_dlist_start(client_entry->attrs);
- while ((attr = silc_dlist_get(client_entry->attrs)) != SILC_LIST_END) {
- attribute = silc_attribute_get_attribute(attr);
- case SILC_ATTRIBUTE_USER_INFO:
- if (!silc_attribute_get_object(attr, (void *)&vcard,
- g_string_append_printf(s, "%s:\n\n", _("Personal Information"));
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t%s\n",
- if (vcard.middle_names)
- g_string_append_printf(s, "%s:\t%s\n",
- g_string_append_printf(s, "%s:\t%s\n",
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t%s\n",
- g_string_append_printf(s, "%s:\t\t%s\n",
- g_string_append_printf(s, "%s:\t%s\n",
- g_string_append_printf(s, "%s:\t%s\n",
- for (i = 0; i < vcard.num_tels; i++) {
- if (vcard.tels[i].telnum)
- g_string_append_printf(s, "%s:\t\t\t%s\n",
- for (i = 0; i < vcard.num_emails; i++) {
- if (vcard.emails[i].address)
- g_string_append_printf(s, "%s:\t\t%s\n",
- vcard.emails[i].address);
- g_string_append_printf(s, "\n%s:\t\t%s\n",
- purple_notify_info(NULL, _("User Information"), _("User Information"),
- g_string_free(s, TRUE);
/* Command reply handler. Delivers a reply to command that was sent
earlier. The `conn' is the associated client connection. The `command'
@@ -1306,15 +1205,6 @@
-#if 0 /* XXX for now, let's not show attrs here */
- if (client_entry->attrs)
- purple_request_action(gc, _("User Information"),
- buf, 1, client_entry, 2,
- _("OK"), G_CALLBACK(silcpurple_whois_more),
- _("_More..."), G_CALLBACK(silcpurple_whois_more), gc->account, NULL, NULL);
purple_notify_userinfo(gc, client_entry->nickname, user_info, NULL, NULL);
purple_notify_user_info_destroy(user_info);
--- a/libpurple/protocols/silc/silc.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/silc/silc.c Thu Feb 15 23:17:27 2018 -0500
@@ -1038,14 +1038,6 @@
purple_request_fields_add_group(fields, g);
g = purple_request_field_group_new(NULL);
- f = purple_request_field_label_new("l2", _("Online Services"));
- purple_request_field_group_add_field(g, f);
- f = purple_request_field_bool_new("services",
- _("Let others see what services you are using"),
- purple_request_field_group_add_field(g, f);
#ifdef HAVE_SYS_UTSNAME_H
f = purple_request_field_bool_new("device",
_("Let others see what computer you are using"),
@@ -2091,20 +2083,6 @@
"prpl-silc", silcpurple_cmd_generic,
_("ping: Send PING to the connected server"), NULL);
cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
-#if 0 /* Purple doesn't handle these yet */
- id = purple_cmd_register("users", "w", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY,
- "prpl-silc", silcpurple_cmd_users,
- _("users <channel>: List users in channel"));
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
- id = purple_cmd_register("names", "ww", PURPLE_CMD_P_PROTOCOL,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PROTOCOL_ONLY |
- PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcpurple_cmd_names,
- _("names [-count|-ops|-halfops|-voices|-normal] <channel(s)>: List specific users in channel(s)"));
- cmds = g_slist_prepend(cmds, GUINT_TO_POINTER(id));
@@ -2135,14 +2113,6 @@
-static SilcBool silcpurple_debug_cb(char *file, char *function, int line,
- char *message, void *context)
- purple_debug_info("SILC", "%s:%d:%s - %s\n", file ? file : "(null)", line, function ? function : "(null)", message ? message : "(null)");
silcpurple_protocol_init(PurpleProtocol *protocol)
@@ -2349,13 +2319,6 @@
silc_log_set_callback(SILC_LOG_ERROR, silcpurple_log_error, NULL);
silcpurple_register_commands();
-silc_log_set_debug_string("*client*");
-silc_log_set_debug_callbacks(silcpurple_debug_cb, NULL, NULL, NULL);
--- a/libpurple/protocols/simple/ntlm.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/simple/ntlm.c Thu Feb 15 23:17:27 2018 -0500
@@ -80,14 +80,6 @@
guint32 flags; /* 0x00008201 */
/* guint32 flags2; */ /* unknown, used in windows messenger */
- guint8 dom[*]; /* domain string (unicode UTF-16LE) */
- guint8 user[*]; /* username string (unicode UTF-16LE) */
- guint8 host[*]; /* host string (unicode UTF-16LE) */
- guint8 lm_resp[*]; /* LanManager response */
- guint8 nt_resp[*]; /* NT response */
--- a/libpurple/protocols/zephyr/ZFmtSmRLst.c Wed Jan 03 15:40:46 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZFormatSmallRawNoticeList function.
- * Created by: John T. Kohl
- * Copyright (c) 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZFormatSmallRawNoticeList(notice, list, nitems, buffer, ret_len)
- if ((retval = Z_FormatRawHeader(notice, buffer, Z_MAXHEADERLEN,
- &hdrlen, NULL, NULL)) != ZERR_NONE)
- size += strlen(list[i])+1;
- *ret_len = hdrlen+size;
- if (*ret_len > Z_MAXPKTLEN)
- for (;nitems;nitems--, list++) {
- (void) memcpy(ptr, *list, i);
--- a/libpurple/protocols/zephyr/ZMkAuth.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/zephyr/ZMkAuth.c Thu Feb 15 23:17:27 2018 -0500
@@ -24,15 +24,6 @@
static KTEXT_ST last_authent;
-Code_t ZResetAuthentication () {
-#ifdef ZEPHYR_USES_KERBEROS
- last_authent_time = 0L;
Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
register ZNotice_t *notice;
--- a/libpurple/protocols/zephyr/ZPeekIfNot.c Wed Jan 03 15:40:46 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZPeekIfNotice function.
- * Created by: Robert French
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZPeekIfNotice(notice, from, predicate, args)
- struct sockaddr_in *from;
- struct _Z_InputQ *qptr;
- if ((retval = Z_WaitForComplete()) != ZERR_NONE)
- qptr = Z_GetFirstComplete();
- if ((retval = ZParseNotice(qptr->packet, qptr->packet_len,
- &tmpnotice)) != ZERR_NONE)
- if ((*predicate)(&tmpnotice, args)) {
- if (!(buffer = (char *) malloc((unsigned) qptr->packet_len)))
- (void) memcpy(buffer, qptr->packet, qptr->packet_len);
- if ((retval = ZParseNotice(buffer, qptr->packet_len,
- notice)) != ZERR_NONE) {
- qptr = Z_GetNextComplete(qptr);
- if ((retval = Z_ReadWait()) != ZERR_NONE)
--- a/libpurple/protocols/zephyr/ZRetSubs.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/zephyr/ZRetSubs.c Thu Feb 15 23:17:27 2018 -0500
@@ -42,22 +42,6 @@
return(Z_RetSubs(¬ice, nsubs, ZAUTH));
-Code_t ZRetrieveDefaultSubscriptions(nsubs)
- (void) memset((char *)¬ice, 0, sizeof(notice));
- notice.z_message = (char *) 0;
- notice.z_message_len = 0;
- notice.z_opcode = CLIENT_GIMMEDEFS;
- return(Z_RetSubs(¬ice, nsubs, ZNOAUTH));
static Code_t Z_RetSubs(notice, nsubs, auth_routine)
register ZNotice_t *notice;
--- a/libpurple/protocols/zephyr/ZSendRLst.c Wed Jan 03 15:40:46 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendRawList function.
- * Created by: John T. Kohl
- * Copyright (c) 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZSendRawList(notice, list, nitems)
- return(ZSrvSendRawList(notice, list, nitems, Z_XmitFragment));
-Code_t ZSrvSendRawList(notice, list, nitems, send_routine)
- Code_t (*send_routine)();
- if ((retval = ZFormatRawNoticeList(notice, list, nitems, &buffer,
- if ((retval = ZParseNotice(buffer, len, &newnotice)) != ZERR_NONE)
- retval = Z_SendFragmentedNotice(&newnotice, len, NULL, send_routine);
--- a/libpurple/protocols/zephyr/ZSendRaw.c Wed Jan 03 15:40:46 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendRawNotice function.
- * Created by: Robert French
- * Copyright (c) 1987 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
-Code_t ZSendRawNotice(notice)
- if ((retval = ZFormatRawNotice(notice, &buffer, &len)) !=
- if ((retval = ZParseNotice(buffer, len, &newnotice)) != ZERR_NONE)
- retval = Z_SendFragmentedNotice(&newnotice, len, NULL, Z_XmitFragment);
--- a/libpurple/protocols/zephyr/meson.build Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/protocols/zephyr/meson.build Thu Feb 15 23:17:27 2018 -0500
@@ -12,7 +12,6 @@
@@ -27,7 +26,6 @@
@@ -38,8 +36,6 @@
--- a/libpurple/server.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/server.c Thu Feb 15 23:17:27 2018 -0500
@@ -295,10 +295,10 @@
protocol = purple_protocols_find(purple_account_get_protocol_id(account));
/* Lookup the attention type in the protocol's attention_types list, if any. */
- if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, get_types)) {
+ if (PURPLE_IS_PROTOCOL_ATTENTION(protocol)) { - attention_types = purple_protocol_attention_iface_get_types(protocol, account);
+ attention_types = purple_protocol_attention_get_types(protocol, account); attn = (PurpleAttentionType *)g_list_nth_data(attention_types, type_code);
--- a/libpurple/server.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/server.h Thu Feb 15 23:17:27 2018 -0500
@@ -29,6 +29,7 @@
#include "conversations.h"
--- a/libpurple/tests/meson.build Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/tests/meson.build Thu Feb 15 23:17:27 2018 -0500
@@ -1,5 +1,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/tests/test_attention_type.c Thu Feb 15 23:17:27 2018 -0500
@@ -0,0 +1,181 @@
+ * Purple is the legal property of its developers, whose names are too + * numerous to list here. Please refer to the COPYRIGHT file distributed + * with this source distribution + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +#include "dbus-server.h" +/****************************************************************************** + *****************************************************************************/ +test_purple_attention_type_new(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + /* check the values new sets */ + g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type), ==, "id"); + g_assert_cmpstr(purple_attention_type_get_name(type), ==, "name"); + g_assert_cmpstr(purple_attention_type_get_incoming_desc(type), ==, "incoming"); + g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type), ==, "outgoing"); + /* check that default values are correct */ + g_assert_cmpstr(purple_attention_type_get_icon_name(type), ==, NULL); +test_purple_attention_type_copy(void) { + PurpleAttentionType *type1 = NULL, *type2 = NULL; + type1 = purple_attention_type_new("id", "name", "incoming", "outgoing"); + type2 = purple_attention_type_copy(type1); + /* check the values new sets */ + g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type2), ==, "id"); + g_assert_cmpstr(purple_attention_type_get_name(type2), ==, "name"); + g_assert_cmpstr(purple_attention_type_get_incoming_desc(type2), ==, "incoming"); + g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type2), ==, "outgoing"); + /* check that default values are correct */ + g_assert_cmpstr(purple_attention_type_get_icon_name(type2), ==, NULL); +test_purple_attention_type_set_unlocalized_name(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + purple_attention_type_set_unlocalized_name(type, "this-is-my-id"); + g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type), ==, "this-is-my-id"); +test_purple_attention_type_set_name(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + purple_attention_type_set_name(type, "this-is-my-name"); + g_assert_cmpstr(purple_attention_type_get_name(type), ==, "this-is-my-name"); +test_purple_attention_type_set_incoming_desc(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + purple_attention_type_set_incoming_desc(type, "this-is-my-incoming-desc"); + g_assert_cmpstr(purple_attention_type_get_incoming_desc(type), ==, "this-is-my-incoming-desc"); +test_purple_attention_type_set_outgoing_desc(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + purple_attention_type_set_outgoing_desc(type, "this-is-my-outgoing-desc"); + g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type), ==, "this-is-my-outgoing-desc"); +test_purple_attention_type_set_icon_name(void) { + PurpleAttentionType *type = NULL; + type = purple_attention_type_new("id", "name", "incoming", "outgoing"); + purple_attention_type_set_icon_name(type, "this-is-my-icon-name"); + g_assert_cmpstr(purple_attention_type_get_icon_name(type), ==, "this-is-my-icon-name"); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + g_test_set_nonfatal_assertions(); + test_purple_attention_type_new + "/attention-type/copy", + test_purple_attention_type_copy + "/attention-type/set-unlocalized-name", + test_purple_attention_type_set_unlocalized_name + "/attention-type/set-name", + test_purple_attention_type_set_name + "/attention-type/set-incoming-desc", + test_purple_attention_type_set_incoming_desc + "/attention-type/set-outgoing-desc", + test_purple_attention_type_set_outgoing_desc + "/attention-type/set-icon-name", + test_purple_attention_type_set_icon_name --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/tests/test_protocol_attention.c Thu Feb 15 23:17:27 2018 -0500
@@ -0,0 +1,156 @@
+ * Purple is the legal property of its developers, whose names are too + * numerous to list here. Please refer to the COPYRIGHT file distributed + * with this source distribution + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +#include "dbus-server.h" +/****************************************************************************** + * PurpleProtcolAttention Implementations + *****************************************************************************/ +static GType test_purple_protocol_attention_get_type(void); +} TestPurpleProtocolAttention; + PurpleProtocolClass parent; +} TestPurpleProtocolAttentionClass; +test_purple_protocol_attention_send(PurpleProtocolAttention *attn, PurpleConnection *c, const gchar *username, guint type) { + TestPurpleProtocolAttention *test_attn = (TestPurpleProtocolAttention *)attn; + test_attn->send_called = TRUE; +test_purple_protocol_attention_get_types(PurpleProtocolAttention *attn, PurpleAccount *acct) { + types = g_list_append(types, purple_attention_type_new("id", "name", "incoming", "outgoing")); +test_purple_protocol_attention_iface_init(PurpleProtocolAttentionInterface *iface) { + iface->send = test_purple_protocol_attention_send; + iface->get_types = test_purple_protocol_attention_get_types; +G_DEFINE_TYPE_WITH_CODE( + TestPurpleProtocolAttention, + test_purple_protocol_attention, + PURPLE_TYPE_PROTOCOL_ATTENTION, + test_purple_protocol_attention_iface_init +test_purple_protocol_attention_init(TestPurpleProtocolAttention *prplattn) { + PurpleProtocol *prpl = PURPLE_PROTOCOL(prplattn); + prpl->id = "prpl-attention"; +test_purple_protocol_attention_class_init(TestPurpleProtocolAttentionClass *klass) { +/****************************************************************************** + *****************************************************************************/ +test_purple_protocol_attention_can_send(void) { + TestPurpleProtocolAttention *attn = g_object_new(test_purple_protocol_attention_get_type(), NULL); + PurpleAccount *a = purple_account_new("prpl-attn-can-send", "prpl-attn"); + PurpleConnection *c = g_object_new(PURPLE_TYPE_CONNECTION, "account", a, NULL); + gboolean actual = FALSE; + attn->send_called = FALSE; + actual = purple_protocol_attention_send(PURPLE_PROTOCOL_ATTENTION(attn), c, "someguy", 0); + g_assert_true(attn->send_called); +test_purple_protocol_attention_can_get_types(void) { + TestPurpleProtocolAttention *attn = g_object_new(test_purple_protocol_attention_get_type(), NULL); + PurpleAccount *a = purple_account_new("prpl-attn-can-get-types", "prpl-attn"); + PurpleAttentionType *type = NULL; + types = purple_protocol_attention_get_types(PURPLE_PROTOCOL_ATTENTION(attn), a); + g_assert_true(g_list_length(types) == 1); + /* take the first item and cast it into type */ + type = (PurpleAttentionType *)(types->data); + g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type), ==, "id"); + g_assert_cmpstr(purple_attention_type_get_name(type), ==, "name"); + g_assert_cmpstr(purple_attention_type_get_incoming_desc(type), ==, "incoming"); + g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type), ==, "outgoing"); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + g_test_set_nonfatal_assertions(); + "/protocol-attention/send", + test_purple_protocol_attention_can_send + "/protocol-attention/get-types", + test_purple_protocol_attention_can_get_types --- a/libpurple/win32/libc_interface.c Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/win32/libc_interface.c Thu Feb 15 23:17:27 2018 -0500
@@ -409,13 +409,6 @@
- /* connection has been gracefully closed */
/* success reading socket */
@@ -933,10 +926,6 @@
if (purple_strequal(tzname, win32_tzmap[i].wstd))
- purple_debug_info("wpurple", "TZ \"%s\" matches Windows timezone \"%s\"\n",
- win32_tzmap[i].ustd, tzname);
if (win32_tzmap[0].wstd[0] != '\0')
@@ -949,10 +938,6 @@
if (purple_strequal(tzname, win32_tzmap[i].wdst))
- purple_debug_info("wpurple", "TZ \"%s\" matches Windows timezone \"%s\"\n",
- win32_tzmap[i].udst, tzname);
if (win32_tzmap[0].wdst[0] != '\0')
@@ -1056,10 +1041,6 @@
if (purple_strequal(localtzname, win32_tzmap[i].wstd))
- purple_debug_info("wpurple", "TZ \"%s\" matches localized Windows timezone \"%s\" (\"%s\")\n",
- win32_tzmap[i].ustd, tzname, localtzname);
if (win32_tzmap[0].wstd[0] != '\0')
g_free(win32_tzmap[0].wstd);
@@ -1070,10 +1051,6 @@
if (purple_strequal(localtzname, win32_tzmap[i].wdst))
- purple_debug_info("wpurple", "TZ \"%s\" matches localized Windows timezone \"%s\" (\"%s\")\n",
- win32_tzmap[i].udst, tzname, localtzname);
if (win32_tzmap[0].wdst[0] != '\0')
g_free(win32_tzmap[0].wdst);
--- a/libpurple/win32/libc_internal.h Wed Jan 03 15:40:46 2018 +0100
+++ b/libpurple/win32/libc_internal.h Thu Feb 15 23:17:27 2018 -0500
@@ -77,36 +77,12 @@
struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- struct sockaddr ifru_hwaddr;
# define ifr_name ifr_ifrn.ifrn_name /* interface name */
# define ifr_addr ifr_ifru.ifru_addr /* address */
-# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
-# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
-# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
-# define ifr_flags ifr_ifru.ifru_flags /* flags */
-# define ifr_metric ifr_ifru.ifru_ivalue /* metric */
-# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
# define ifr_data ifr_ifru.ifru_data /* for use by interface */
-# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
-# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
-# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */
--- a/meson.build Wed Jan 03 15:40:46 2018 +0100
+++ b/meson.build Thu Feb 15 23:17:27 2018 -0500
@@ -406,7 +406,7 @@
# Check Pidgin dependencies
# #######################################################################
- gtk = dependency('gtk+-3.0', version : '>= 3.4.2')
+ gtk = dependency('gtk+-3.0', version : '>= 3.10.0') # We only really need Pango >= 1.4 for decent RTL support
pango = dependency('pango', version : '>= 1.4.0')
conf.set('HAVE_PANGO14', pango.found())
--- a/pidgin/gtkconv.c Wed Jan 03 15:40:46 2018 +0100
+++ b/pidgin/gtkconv.c Thu Feb 15 23:17:27 2018 -0500
@@ -31,6 +31,7 @@
#include <gdk/gdkkeysyms.h>
@@ -3444,8 +3445,8 @@
protocol = purple_connection_get_protocol(pc);
- if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, get_types)) {
- list = purple_protocol_attention_iface_get_types(protocol, purple_connection_get_account(pc));
+ if (protocol && PURPLE_IS_PROTOCOL_ATTENTION(protocol)) { + list = purple_protocol_attention_get_types(PURPLE_PROTOCOL_ATTENTION(protocol), purple_connection_get_account(pc)); /* Multiple attention types */
if (list && list->next) {
@@ -7432,7 +7433,7 @@
gtk_action_set_sensitive(win->menu->add, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, add_buddy)));
gtk_action_set_sensitive(win->menu->remove, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, remove_buddy)));
gtk_action_set_sensitive(win->menu->send_file, can_send_file);
- gtk_action_set_sensitive(win->menu->get_attention, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, send)));
+ gtk_action_set_sensitive(win->menu->get_attention, (PURPLE_IS_PROTOCOL_ATTENTION(protocol))); gtk_action_set_sensitive(win->menu->alias,
(purple_blist_find_buddy(account, purple_conversation_get_name(conv)) != NULL));
--- a/pidgin/gtkwebviewtoolbar.c Wed Jan 03 15:40:46 2018 +0100
+++ b/pidgin/gtkwebviewtoolbar.c Thu Feb 15 23:17:27 2018 -0500
@@ -1682,7 +1682,7 @@
for the time being it is always disabled for chats */
gtk_action_set_sensitive(priv->attention,
conv && protocol && PURPLE_IS_IM_CONVERSATION(conv) &&
- PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, send));
+ PURPLE_IS_PROTOCOL_ATTENTION(protocol)); update_smiley_button(toolbar);