pidgin/pidgin

xmpp: Remove unused prototypes and code

21 months ago, Elliott Sales de Andrade
3bf884522663
Parents ce196b6cc635
Children 715d38814f5d
xmpp: Remove unused prototypes and code

Many functions are 'public' in that they are in header files, but they don't need to be. The `jabber.c` ones were likely there because of the xmpp/gtalk multi-library thing that's gone now.

This removal is 'naive', in that if a prototype is necessary for now-`static` functions, then that's all I did, instead of any re-ordering.

I also left in some 'unused' `data.c` functions as their use was deleted when removing smileys and they _may_ still be needed.

Testing Done:
Compiled.

Reviewed at https://reviews.imfreedom.org/r/1905/
--- a/libpurple/protocols/jabber/adhoccommands.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/adhoccommands.c Fri Oct 07 01:21:28 2022 -0500
@@ -30,6 +30,8 @@
#include "xdata.h"
#include "iq.h"
+static void jabber_adhoc_execute(JabberStream *js, JabberAdHocCommands *cmd);
+
void
jabber_adhoc_commands_free(JabberAdHocCommands *cmd)
{
@@ -299,7 +301,8 @@
jabber_iq_send(iq);
}
-void jabber_adhoc_execute(JabberStream *js, JabberAdHocCommands *cmd) {
+static void
+jabber_adhoc_execute(JabberStream *js, JabberAdHocCommands *cmd) {
JabberIq *iq = jabber_iq_new(js, JABBER_IQ_SET);
PurpleXmlNode *command = purple_xmlnode_new_child(iq->node,"command");
purple_xmlnode_set_attrib(iq->node,"to",cmd->jid);
--- a/libpurple/protocols/jabber/adhoccommands.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/adhoccommands.h Fri Oct 07 01:21:28 2022 -0500
@@ -40,8 +40,6 @@
JabberIqType type, const char *id,
PurpleXmlNode *packet, gpointer data);
-void jabber_adhoc_execute(JabberStream *js, JabberAdHocCommands *cmd);
-
void jabber_adhoc_execute_action(PurpleBlistNode *node, gpointer data);
void jabber_adhoc_got_list(JabberStream *js, const char *from, PurpleXmlNode *query);
--- a/libpurple/protocols/jabber/auth.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/auth.c Fri Oct 07 01:21:28 2022 -0500
@@ -497,16 +497,11 @@
return 0;
}
-void jabber_auth_add_mech(JabberSaslMech *mech)
-{
+static void
+jabber_auth_add_mech(JabberSaslMech *mech) {
auth_mechs = g_slist_insert_sorted(auth_mechs, mech, compare_mech);
}
-void jabber_auth_remove_mech(JabberSaslMech *mech)
-{
- auth_mechs = g_slist_remove(auth_mechs, mech);
-}
-
void jabber_auth_init(void)
{
JabberSaslMech **tmp;
--- a/libpurple/protocols/jabber/auth.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/auth.h Fri Oct 07 01:21:28 2022 -0500
@@ -59,9 +59,6 @@
JabberSaslMech *jabber_auth_get_cyrus_mech(void);
JabberSaslMech *jabber_auth_get_webex_token_mech(void);
-void jabber_auth_add_mech(JabberSaslMech *);
-void jabber_auth_remove_mech(JabberSaslMech *);
-
void jabber_auth_init(void);
void jabber_auth_uninit(void);
--- a/libpurple/protocols/jabber/buddy.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/buddy.c Fri Oct 07 01:21:28 2022 -0500
@@ -2183,7 +2183,8 @@
}
}
-void jabber_user_search(JabberStream *js, const char *directory)
+static void
+jabber_user_search(JabberStream *js, const char *directory)
{
JabberIq *iq;
@@ -2270,20 +2271,6 @@
return (node != NULL);
}
-gboolean
-jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap)
-{
- JabberBuddyResource *jbr = jabber_buddy_find_resource((JabberBuddy*)jb, NULL);
-
- if (!jbr) {
- purple_debug_info("jabber",
- "Unable to find caps: buddy might be offline\n");
- return FALSE;
- }
-
- return jabber_resource_has_capability(jbr, cap);
-}
-
const gchar *
jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr,
const gchar *category)
--- a/libpurple/protocols/jabber/buddy.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/buddy.h Fri Oct 07 01:21:28 2022 -0500
@@ -99,7 +99,6 @@
void jabber_setup_set_info(GSimpleAction *action, GVariant *parameter, gpointer data);
void jabber_set_buddy_icon(PurpleProtocolServer *protocol_server, PurpleConnection *gc, PurpleImage *img);
-void jabber_user_search(JabberStream *js, const char *directory);
void jabber_user_search_begin(GSimpleAction *action, GVariant *parameter, gpointer data);
void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js);
@@ -109,7 +108,6 @@
gboolean jabber_resource_know_capabilities(const JabberBuddyResource *jbr);
gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr,
const gchar *cap);
-gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap);
const gchar *
jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr,
--- a/libpurple/protocols/jabber/chat.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/chat.c Fri Oct 07 01:21:28 2022 -0500
@@ -251,9 +251,20 @@
return chat;
}
-JabberChat *jabber_join_chat(JabberStream *js, const char *room,
- const char *server, const char *handle,
- const char *password, GHashTable *data)
+/*
+ * jabber_join_chat:
+ * @room: The room to join. This MUST be normalized already.
+ * @server: The server the room is on. This MUST be normalized already.
+ * @password: (nullable): The password (if required) to join the room.
+ * @data: (nullable): The chat hash table. If NULL, it will be generated for
+ * current core<>protocol API interface.
+ *
+ * In-protocol function for joining a chat room. Doesn't require sticking goop
+ * into a hash table.
+ */
+static JabberChat *
+jabber_join_chat(JabberStream *js, const char *room, const char *server,
+ const char *handle, const char *password, GHashTable *data)
{
JabberChat *chat;
@@ -1193,61 +1204,3 @@
g_free(room_jid);
}
-
-typedef struct {
- const gchar *cap;
- gboolean *all_support;
- JabberBuddy *jb;
-} JabberChatCapsData;
-
-static void
-jabber_chat_all_participants_have_capability_foreach(gpointer key,
- gpointer value,
- gpointer user_data)
-{
- const gchar *cap = ((JabberChatCapsData *) user_data)->cap;
- gboolean *all_support = ((JabberChatCapsData *) user_data)->all_support;
- JabberBuddy *jb = ((JabberChatCapsData *) user_data)->jb;
- JabberChatMember *member = (JabberChatMember *) value;
- const gchar *resource = member->handle;
- JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, resource);
-
- if (jbr) {
- if (*all_support && jabber_resource_has_capability(jbr, cap))
- *all_support = TRUE;
- } else {
- *all_support = FALSE;
- }
-}
-
-gboolean
-jabber_chat_all_participants_have_capability(const JabberChat *chat,
- const gchar *cap)
-{
- gchar *chat_jid = NULL;
- JabberBuddy *jb = NULL;
- gboolean all_support = TRUE;
- JabberChatCapsData data;
-
- chat_jid = g_strdup_printf("%s@%s", chat->room, chat->server);
- jb = jabber_buddy_find(chat->js, chat_jid, FALSE);
-
- if (jb) {
- data.cap = cap;
- data.all_support = &all_support;
- data.jb = jb;
-
- g_hash_table_foreach(chat->members,
- jabber_chat_all_participants_have_capability_foreach, &data);
- } else {
- all_support = FALSE;
- }
- g_free(chat_jid);
- return all_support;
-}
-
-guint
-jabber_chat_get_num_participants(const JabberChat *chat)
-{
- return g_hash_table_size(chat->members);
-}
--- a/libpurple/protocols/jabber/chat.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/chat.h Fri Oct 07 01:21:28 2022 -0500
@@ -56,20 +56,6 @@
GHashTable *jabber_chat_info_defaults(PurpleConnection *gc, const char *chat_name);
char *jabber_get_chat_name(PurpleProtocolChat *protocol_chat, GHashTable *data);
-/**
- * in-protocol function for joining a chat room. Doesn't require sticking goop
- * into a hash table.
- *
- * @param room The room to join. This MUST be normalized already.
- * @param server The server the room is on. This MUST be normalized already.
- * @param password The password (if required) to join the room. May be NULL.
- * @param data The chat hash table. May be NULL (it will be generated
- * for current core<>protocol API interface.)
- */
-JabberChat *jabber_join_chat(JabberStream *js, const char *room,
- const char *server, const char *handle,
- const char *password, GHashTable *data);
-
void jabber_chat_join(PurpleConnection *gc, GHashTable *data);
JabberChat *jabber_chat_find(JabberStream *js, const char *room,
const char *server);
@@ -107,8 +93,4 @@
void jabber_chat_disco_traffic(JabberChat *chat);
-gboolean jabber_chat_all_participants_have_capability(const JabberChat *chat,
- const gchar *cap);
-guint jabber_chat_get_num_participants(const JabberChat *chat);
-
#endif /* PURPLE_JABBER_CHAT_H */
--- a/libpurple/protocols/jabber/data.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/data.c Fri Oct 07 01:21:28 2022 -0500
@@ -412,7 +412,8 @@
g_hash_table_insert(remote_data_by_cid, cid, data);
}
-void
+/* Handles iq requests. */
+static void
jabber_data_parse(JabberStream *js, const char *who, JabberIqType type,
const char *id, PurpleXmlNode *data_node)
{
--- a/libpurple/protocols/jabber/data.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/data.h Fri Oct 07 01:21:28 2022 -0500
@@ -84,10 +84,6 @@
void jabber_data_associate_remote(JabberStream *js, const gchar *who,
JabberData *data);
-/* handles iq requests */
-void jabber_data_parse(JabberStream *js, const char *who, JabberIqType type,
- const char *id, PurpleXmlNode *data_node);
-
void jabber_data_init(void);
void jabber_data_uninit(void);
--- a/libpurple/protocols/jabber/ibb.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/ibb.c Fri Oct 07 01:21:28 2022 -0500
@@ -32,6 +32,8 @@
static GHashTable *jabber_ibb_sessions = NULL;
static GList *open_handlers = NULL;
+static JabberStream *jabber_ibb_session_get_js(JabberIBBSession *sess);
+
JabberIBBSession *
jabber_ibb_session_create(JabberStream *js, const gchar *sid, const gchar *who,
gpointer user_data)
@@ -107,31 +109,31 @@
g_free(sess);
}
-const gchar *
+static const gchar *
jabber_ibb_session_get_sid(const JabberIBBSession *sess)
{
return sess->sid;
}
-JabberStream *
+static JabberStream *
jabber_ibb_session_get_js(JabberIBBSession *sess)
{
return sess->js;
}
-const gchar *
+static const gchar *
jabber_ibb_session_get_who(const JabberIBBSession *sess)
{
return sess->who;
}
-guint16
+static guint16
jabber_ibb_session_get_send_seq(const JabberIBBSession *sess)
{
return sess->send_seq;
}
-guint16
+static guint16
jabber_ibb_session_get_recv_seq(const JabberIBBSession *sess)
{
return sess->recv_seq;
@@ -149,17 +151,6 @@
return sess->block_size;
}
-void
-jabber_ibb_session_set_block_size(JabberIBBSession *sess, gsize size)
-{
- if (jabber_ibb_session_get_state(sess) == JABBER_IBB_SESSION_NOT_OPENED) {
- sess->block_size = size;
- } else {
- purple_debug_error("jabber",
- "Can't set block size on an open IBB session\n");
- }
-}
-
gsize
jabber_ibb_session_get_max_data_size(const JabberIBBSession *sess)
{
@@ -273,18 +264,6 @@
}
}
-void
-jabber_ibb_session_accept(JabberIBBSession *sess)
-{
- JabberIq *result = jabber_iq_new(jabber_ibb_session_get_js(sess),
- JABBER_IQ_RESULT);
-
- purple_xmlnode_set_attrib(result->node, "to", jabber_ibb_session_get_who(sess));
- jabber_iq_set_id(result, sess->id);
- jabber_iq_send(result);
- sess->state = JABBER_IBB_SESSION_OPENED;
-}
-
static void
jabber_ibb_session_send_acknowledge_cb(JabberStream *js, const char *from,
JabberIqType type, const char *id,
@@ -379,7 +358,8 @@
jabber_iq_send(result);
}
-void
+/* Handle incoming packet. */
+static void
jabber_ibb_parse(JabberStream *js, const char *who, JabberIqType type,
const char *id, PurpleXmlNode *child)
{
--- a/libpurple/protocols/jabber/ibb.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/ibb.h Fri Oct 07 01:21:28 2022 -0500
@@ -94,21 +94,12 @@
void jabber_ibb_session_open(JabberIBBSession *sess);
void jabber_ibb_session_close(JabberIBBSession *sess);
-void jabber_ibb_session_accept(JabberIBBSession *sess);
void jabber_ibb_session_send_data(JabberIBBSession *sess, gconstpointer data,
gsize size);
-const gchar *jabber_ibb_session_get_sid(const JabberIBBSession *sess);
-JabberStream *jabber_ibb_session_get_js(JabberIBBSession *sess);
-const gchar *jabber_ibb_session_get_who(const JabberIBBSession *sess);
-
-guint16 jabber_ibb_session_get_send_seq(const JabberIBBSession *sess);
-guint16 jabber_ibb_session_get_recv_seq(const JabberIBBSession *sess);
-
JabberIBBSessionState jabber_ibb_session_get_state(const JabberIBBSession *sess);
gsize jabber_ibb_session_get_block_size(const JabberIBBSession *sess);
-void jabber_ibb_session_set_block_size(JabberIBBSession *sess, gsize size);
/* get maximum size data block to send (in bytes)
(before encoded to BASE64) */
@@ -116,10 +107,6 @@
gpointer jabber_ibb_session_get_user_data(JabberIBBSession *sess);
-/* handle incoming packet */
-void jabber_ibb_parse(JabberStream *js, const char *who, JabberIqType type,
- const char *id, PurpleXmlNode *child);
-
/* add a handler for open session */
void jabber_ibb_register_open_handler(JabberIBBOpenHandler *cb);
void jabber_ibb_unregister_open_handler(JabberIBBOpenHandler *cb);
--- a/libpurple/protocols/jabber/jabber.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/jabber.c Fri Oct 07 01:21:28 2022 -0500
@@ -78,6 +78,10 @@
static gint plugin_ref = 0;
static void jabber_unregister_account_cb(JabberStream *js);
+static void jabber_send_raw(PurpleProtocolServer *protocol_server, JabberStream *js, const gchar *data, gint len);
+static void jabber_remove_feature(const gchar *namespace);
+static gboolean jabber_initiate_media(PurpleProtocolMedia *media, PurpleAccount *account, const char *who, PurpleMediaSessionType type);
+static PurpleMediaCaps jabber_get_media_caps(PurpleProtocolMedia *media, PurpleAccount *account, const char *who);
static void jabber_stream_init(JabberStream *js)
{
@@ -403,7 +407,7 @@
return success;
}
-void
+static void
jabber_send_raw(PurpleProtocolServer *protocol_server, JabberStream *js,
const gchar *data, gint len)
{
@@ -509,7 +513,7 @@
do_jabber_send_raw(js, data, len);
}
-gint
+static gint
jabber_protocol_send_raw(PurpleProtocolServer *protocol_server,
PurpleConnection *gc, const gchar *buf, gint len)
{
@@ -525,8 +529,9 @@
return (len < 0 ? (int)strlen(buf) : len);
}
-void jabber_send_signal_cb(PurpleConnection *pc, PurpleXmlNode **packet,
- gpointer unused)
+static void
+jabber_send_signal_cb(PurpleConnection *pc, PurpleXmlNode **packet,
+ G_GNUC_UNUSED gpointer unused)
{
JabberStream *js;
char *txt;
@@ -566,7 +571,7 @@
return FALSE;
}
-void
+static void
jabber_keepalive(PurpleProtocolServer *protocol_server, PurpleConnection *gc) {
JabberStream *js = purple_connection_get_protocol_data(gc);
@@ -998,7 +1003,7 @@
}
}
-void
+static void
jabber_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
PurpleConnection *gc = purple_account_get_connection(account);
JabberStream *js;
@@ -1423,15 +1428,7 @@
jabber_iq_send(iq);
}
-void jabber_register_gateway(JabberStream *js, const char *gateway) {
- JabberIq *iq;
-
- iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:register");
- purple_xmlnode_set_attrib(iq->node, "to", gateway);
- jabber_iq_send(iq);
-}
-
-void
+static void
jabber_register_account(PurpleProtocolServer *protocol_server,
PurpleAccount *account)
{
@@ -1487,7 +1484,7 @@
jabber_iq_send(iq);
}
-void
+static void
jabber_unregister_account(PurpleProtocolServer *protocol_server,
PurpleAccount *account,
PurpleAccountUnregistrationCb cb, gpointer user_data)
@@ -1527,7 +1524,7 @@
* termination before destroying everything. That seems like it would require
* changing the semantics of protocol's close(), so it's a good idea for 3.0.0.
*/
-void
+static void
jabber_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
JabberStream *js = purple_connection_get_protocol_data(gc);
@@ -1650,7 +1647,7 @@
}
-void
+static void
jabber_idle_set(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
gint idle)
{
@@ -1779,8 +1776,9 @@
jabber_iq_send(iq);
}
-void jabber_add_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc,
- const char *who)
+static void
+jabber_add_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc,
+ const char *who)
{
JabberStream *js;
JabberIq *iq;
@@ -1811,8 +1809,9 @@
jabber_iq_send(iq);
}
-void jabber_remove_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc,
- const char *who)
+static void
+jabber_remove_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc,
+ const char *who)
{
JabberStream *js;
JabberIq *iq;
@@ -1860,7 +1859,8 @@
g_free(feature);
}
-void jabber_remove_feature(const char *namespace) {
+static void
+jabber_remove_feature(const char *namespace) {
GList *feature;
for(feature = jabber_features; feature; feature = feature->next) {
JabberFeature *feat = (JabberFeature*)feature->data;
@@ -1918,8 +1918,23 @@
g_free(id);
}
-void jabber_add_identity(const gchar *category, const gchar *type,
- const gchar *lang, const gchar *name)
+/*
+ * jabber_add_identity:
+ * @category: The category of the identity.
+ * @type: The type of the identity.
+ * @language: (nullable): The language localization of the name.
+ * @name: The name of the identity.
+ *
+ * Adds an identity to this jabber library instance. For list of valid values
+ * visit the website of the XMPP Registrar
+ * (http://xmpp.org/registrar/disco-categories.html#client)
+ *
+ * Like with jabber_add_feature, if you call this while accounts are connected,
+ * Bad Things will happen.
+ */
+static void
+jabber_add_identity(const gchar *category, const gchar *type,
+ const gchar *lang, const gchar *name)
{
GList *identity;
JabberIdentity *ident;
@@ -1990,7 +2005,7 @@
inactivity_cb, js);
}
-const char *
+static const char *
jabber_list_emblem(PurpleProtocolClient *client, PurpleBuddy *b) {
JabberStream *js;
JabberBuddy *jb = NULL;
@@ -2033,7 +2048,7 @@
return NULL;
}
-char *
+static char *
jabber_status_text(PurpleProtocolClient *client, PurpleBuddy *b) {
char *ret = NULL;
JabberBuddy *jb = NULL;
@@ -2111,7 +2126,7 @@
g_free(res);
}
-void
+static void
jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b,
PurpleNotifyUserInfo *user_info, gboolean full)
{
@@ -2225,7 +2240,7 @@
}
}
-GList *
+static GList *
jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol,
PurpleAccount *account)
{
@@ -2543,7 +2558,7 @@
return menu;
}
-PurpleChat *
+static PurpleChat *
jabber_find_blist_chat(PurpleProtocolClient *client, PurpleAccount *account,
const char *name)
{
@@ -2585,7 +2600,7 @@
return NULL;
}
-void
+static void
jabber_convo_closed(PurpleProtocolClient *client, PurpleConnection *gc,
const char *who)
{
@@ -3079,12 +3094,12 @@
return PURPLE_CMD_RET_OK;
}
-gboolean
+static gboolean
jabber_offline_message(PurpleProtocolClient *client, PurpleBuddy *buddy) {
return TRUE;
}
-gboolean
+static gboolean
jabber_audio_enabled(JabberStream *js, const char *namespace)
{
PurpleMediaManager *manager = purple_media_manager_get();
@@ -3093,7 +3108,7 @@
return (caps & (PURPLE_MEDIA_CAPS_AUDIO | PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION));
}
-gboolean
+static gboolean
jabber_video_enabled(JabberStream *js, const char *namespace)
{
PurpleMediaManager *manager = purple_media_manager_get();
@@ -3132,7 +3147,7 @@
g_free(request);
}
-gboolean
+static gboolean
jabber_initiate_media(PurpleProtocolMedia *media, PurpleAccount *account,
const gchar *who, PurpleMediaSessionType type)
{
@@ -3273,7 +3288,7 @@
return FALSE;
}
-PurpleMediaCaps
+static PurpleMediaCaps
jabber_get_media_caps(PurpleProtocolMedia *media, PurpleAccount *account,
const gchar *who)
{
@@ -3356,7 +3371,9 @@
return total;
}
-gboolean jabber_can_receive_file(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *who)
+static gboolean
+jabber_can_receive_file(PurpleProtocolXfer *prplxfer, PurpleConnection *gc,
+ const char *who)
{
JabberStream *js = purple_connection_get_protocol_data(gc);
--- a/libpurple/protocols/jabber/jabber.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/jabber.h Fri Oct 07 01:21:28 2022 -0500
@@ -294,9 +294,6 @@
void jabber_stream_features_parse(JabberStream *js, PurpleXmlNode *packet);
void jabber_process_packet(JabberStream *js, PurpleXmlNode **packet);
void jabber_send(JabberStream *js, PurpleXmlNode *data);
-void jabber_send_raw(PurpleProtocolServer *protocol_server, JabberStream *js, const char *data, int len);
-void jabber_send_signal_cb(PurpleConnection *pc, PurpleXmlNode **packet,
- gpointer unused);
void jabber_stream_set_state(JabberStream *js, JabberStreamState state);
@@ -325,21 +322,6 @@
* will advertised; may be NULL.
*/
void jabber_add_feature(const gchar *namespace, JabberFeatureEnabled cb);
-void jabber_remove_feature(const gchar *namespace);
-
-/** Adds an identity to this jabber library instance. For list of valid values
- * visit the website of the XMPP Registrar
- * (http://xmpp.org/registrar/disco-categories.html#client)
- *
- * Like with jabber_add_feature, if you call this while accounts are connected,
- * Bad Things will happen.
- *
- * @param category the category of the identity.
- * @param type the type of the identity.
- * @param language the language localization of the name. Can be NULL.
- * @param name the name of the identity.
- */
-void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name);
JabberIdentity *jabber_identity_new(const gchar *category, const gchar *type, const gchar *lang, const gchar *name);
void jabber_identity_free(JabberIdentity *id);
@@ -366,33 +348,9 @@
void jabber_stream_restart_inactivity_timer(JabberStream *js);
/** Protocol functions */
-const char* jabber_list_emblem(PurpleProtocolClient *client, PurpleBuddy *b);
-char *jabber_status_text(PurpleProtocolClient *client, PurpleBuddy *b);
-void jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full);
-GList *jabber_status_types(PurpleProtocol *protocol, PurpleAccount *account);
-void jabber_login(PurpleProtocol *protocol, PurpleAccount *account);
-void jabber_close(PurpleProtocol *protocol, PurpleConnection *gc);
-void jabber_idle_set(PurpleProtocolServer *protocol_server, PurpleConnection *gc, int idle);
void jabber_blocklist_parse_push(JabberStream *js, const char *from,
JabberIqType type, const char *id,
PurpleXmlNode *child);
void jabber_request_block_list(JabberStream *js);
-void jabber_add_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc, const char *who);
-void jabber_remove_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc, const char *who);
-void jabber_keepalive(PurpleProtocolServer *protocol_server, PurpleConnection *gc);
-void jabber_register_gateway(JabberStream *js, const char *gateway);
-void jabber_register_account(PurpleProtocolServer *protocol_server, PurpleAccount *account);
-void jabber_unregister_account(PurpleProtocolServer *protocol_server, PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
-void jabber_convo_closed(PurpleProtocolClient *client, PurpleConnection *gc, const char *who);
-PurpleChat *jabber_find_blist_chat(PurpleProtocolClient *client, PurpleAccount *account, const char *name);
-gboolean jabber_offline_message(PurpleProtocolClient *client, PurpleBuddy *buddy);
-int jabber_protocol_send_raw(PurpleProtocolServer *protocol_server, PurpleConnection *gc, const char *buf, int len);
-GList *jabber_get_actions(PurpleProtocolClient *client, PurpleConnection *gc);
-
-gboolean jabber_audio_enabled(JabberStream *js, const char *unused);
-gboolean jabber_video_enabled(JabberStream *js, const char *unused);
-gboolean jabber_initiate_media(PurpleProtocolMedia *media, PurpleAccount *account, const char *who, PurpleMediaSessionType type);
-PurpleMediaCaps jabber_get_media_caps(PurpleProtocolMedia *media, PurpleAccount *account, const char *who);
-gboolean jabber_can_receive_file(PurpleProtocolXfer *xfer, PurpleConnection *gc, const gchar *who);
#endif /* PURPLE_JABBER_JABBER_H */
--- a/libpurple/protocols/jabber/jutil.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/jutil.c Fri Oct 07 01:21:28 2022 -0500
@@ -400,20 +400,6 @@
purple_strequal(jid1->resource, jid2->resource);
}
-char *jabber_get_domain(const char *in)
-{
- JabberID *jid = jabber_id_new(in);
- char *out;
-
- if (!jid)
- return NULL;
-
- out = g_strdup(jid->domain);
- jabber_id_free(jid);
-
- return out;
-}
-
char *jabber_get_resource(const char *in)
{
JabberID *jid = jabber_id_new(in);
@@ -428,17 +414,6 @@
return out;
}
-JabberID *
-jabber_id_to_bare_jid(const JabberID *jid)
-{
- JabberID *result = g_new0(JabberID, 1);
-
- result->node = g_strdup(jid->node);
- result->domain = g_strdup(jid->domain);
-
- return result;
-}
-
char *
jabber_get_bare_jid(const char *in)
{
@@ -528,28 +503,6 @@
}
gboolean
-jabber_is_own_server(JabberStream *js, const char *str)
-{
- JabberID *jid;
- gboolean equal;
-
- if (str == NULL)
- return FALSE;
-
- g_return_val_if_fail(*str != '\0', FALSE);
-
- jid = jabber_id_new(str);
- if (!jid)
- return FALSE;
-
- equal = (jid->node == NULL &&
- purple_strequal(jid->domain, js->user->domain) &&
- jid->resource == NULL);
- jabber_id_free(jid);
- return equal;
-}
-
-gboolean
jabber_is_own_account(JabberStream *js, const char *str)
{
JabberID *jid;
--- a/libpurple/protocols/jabber/jutil.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/jutil.h Fri Oct 07 01:21:28 2022 -0500
@@ -54,20 +54,15 @@
void jabber_id_free(JabberID *jid);
-char *jabber_get_domain(const char *jid);
char *jabber_get_resource(const char *jid);
char *jabber_get_bare_jid(const char *jid);
char *jabber_id_get_bare_jid(const JabberID *jid);
char *jabber_id_get_full_jid(const JabberID *jid);
-JabberID *jabber_id_to_bare_jid(const JabberID *jid);
gboolean jabber_jid_is_domain(const char *jid);
const char *jabber_normalize(const PurpleAccount *account, const char *in);
-/* Returns true if JID is the bare JID of our server. */
-gboolean jabber_is_own_server(JabberStream *js, const char *jid);
-
/* Returns true if JID is the bare JID of our account. */
gboolean jabber_is_own_account(JabberStream *js, const char *jid);
--- a/libpurple/protocols/jabber/pep.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/pep.c Fri Oct 07 01:21:28 2022 -0500
@@ -142,25 +142,6 @@
g_free(jid);
}
-void jabber_pep_delete_node(JabberStream *js, const gchar *node)
-{
- JabberIq *iq;
- PurpleXmlNode *pubsub, *del;
-
- g_return_if_fail(node != NULL);
- g_return_if_fail(js->pep);
-
- iq = jabber_iq_new(js, JABBER_IQ_SET);
-
- pubsub = purple_xmlnode_new_child(iq->node, "pubsub");
- purple_xmlnode_set_namespace(pubsub, "http://jabber.org/protocol/pubsub#owner");
-
- del = purple_xmlnode_new_child(pubsub, "delete");
- purple_xmlnode_set_attrib(del, "node", node);
-
- jabber_iq_send(iq);
-}
-
void jabber_pep_publish(JabberStream *js, PurpleXmlNode *publish) {
JabberIq *iq;
PurpleXmlNode *pubsub;
--- a/libpurple/protocols/jabber/pep.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/pep.h Fri Oct 07 01:21:28 2022 -0500
@@ -76,11 +76,6 @@
void jabber_handle_event(JabberMessage *jm);
-/**
- * Delete the specified PEP node.
- */
-void jabber_pep_delete_node(JabberStream *js, const gchar *node);
-
/*
* Publishes PEP item(s)
*
--- a/libpurple/protocols/jabber/presence.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/presence.c Fri Oct 07 01:21:28 2022 -0500
@@ -50,6 +50,10 @@
/* { NULL, JABBER_PRESENCE_AVAILABLE } the default */
};
+typedef void (JabberPresenceHandler)(JabberStream *js,
+ JabberPresence *presence,
+ PurpleXmlNode *child);
+
static JabberPresenceType
str_to_presence_type(const char *type)
{
@@ -1238,8 +1242,9 @@
presence->chat_info.item = purple_xmlnode_get_child(x, "item");
}
-void jabber_presence_register_handler(const char *node, const char *xmlns,
- JabberPresenceHandler *handler)
+static void
+jabber_presence_register_handler(const char *node, const char *xmlns,
+ JabberPresenceHandler *handler)
{
/*
* This is valid because nodes nor namespaces cannot have spaces in them
--- a/libpurple/protocols/jabber/presence.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/presence.h Fri Oct 07 01:21:28 2022 -0500
@@ -76,11 +76,6 @@
gboolean adjust_idle_for_delay;
};
-typedef void (JabberPresenceHandler)(JabberStream *js, JabberPresence *presence,
- PurpleXmlNode *child);
-void jabber_presence_register_handler(const char *node, const char *xmlns,
- JabberPresenceHandler *handler);
-
void jabber_presence_init(void);
void jabber_presence_uninit(void);
--- a/libpurple/protocols/jabber/roster.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/roster.c Fri Oct 07 01:21:28 2022 -0500
@@ -30,6 +30,8 @@
#include <string.h>
+static const gchar *jabber_roster_group_get_global_name(PurpleGroup *group);
+
/* Take a list of strings and join them with a ", " separator */
static gchar *roster_groups_join(GSList *list)
{
@@ -498,7 +500,7 @@
}
}
-const gchar *
+static const gchar *
jabber_roster_group_get_global_name(PurpleGroup *group)
{
const gchar *name = NULL;
--- a/libpurple/protocols/jabber/roster.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/roster.h Fri Oct 07 01:21:28 2022 -0500
@@ -46,7 +46,4 @@
void jabber_roster_remove_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc, PurpleBuddy *buddy,
PurpleGroup *group);
-const gchar *
-jabber_roster_group_get_global_name(PurpleGroup *group);
-
#endif /* PURPLE_JABBER_ROSTER_H */
--- a/libpurple/protocols/jabber/si.c Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/si.c Fri Oct 07 01:21:28 2022 -0500
@@ -1702,8 +1702,9 @@
}
#endif
-void jabber_si_parse(JabberStream *js, const char *from, JabberIqType type,
- const char *id, PurpleXmlNode *si)
+static void
+jabber_si_parse(JabberStream *js, const char *from, JabberIqType type,
+ const char *id, PurpleXmlNode *si)
{
JabberSIXfer *jsx;
PurpleXmlNode *file, *feature, *x, *field, *option, *value;
--- a/libpurple/protocols/jabber/si.h Thu Oct 06 23:56:19 2022 -0500
+++ b/libpurple/protocols/jabber/si.h Fri Oct 07 01:21:28 2022 -0500
@@ -36,8 +36,6 @@
void jabber_bytestreams_parse(JabberStream *js, const char *from,
JabberIqType type, const char *id, PurpleXmlNode *query);
-void jabber_si_parse(JabberStream *js, const char *from, JabberIqType type,
- const char *id, PurpleXmlNode *si);
PurpleXfer *jabber_si_new_xfer(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *who);
void jabber_si_xfer_send(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *who, const char *file);