pidgin/pidgin

7646d24a31be
Parents 2124729f5026
Children 103594fbcf6b
Inline purple_serv_get_info and purple_serv_set_info

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/2071/
--- a/ChangeLog.API Thu Nov 17 23:38:41 2022 -0600
+++ b/ChangeLog.API Fri Nov 18 00:56:22 2022 -0600
@@ -675,8 +675,10 @@
* purple_running_osx
* purple_serv_add_deny
* purple_serv_add_permit
+ * purple_serv_get_info
* purple_serv_remove_deny
* purple_serv_remove_permit
+ * purple_serv_set_info
* purple_serv_set_permit_deny
* PurpleSetPublicAliasFailureCallback
* PurpleSetPublicAliasSuccessCallback
--- a/finch/gntblist.c Thu Nov 17 23:38:41 2022 -0600
+++ b/finch/gntblist.c Fri Nov 18 00:56:22 2022 -0600
@@ -1105,13 +1105,24 @@
gpointer finch_retrieve_user_info(PurpleConnection *conn, const char *name)
{
- PurpleNotifyUserInfo *info = purple_notify_user_info_new();
+ PurpleProtocol *protocol = NULL;
+ PurpleNotifyUserInfo *info = NULL;
gpointer uihandle;
+
+ protocol = purple_connection_get_protocol(conn);
+
+ if(!PURPLE_IS_PROTOCOL_SERVER(protocol)) {
+ return;
+ }
+
+ purple_protocol_server_get_info(PURPLE_PROTOCOL_SERVER(protocol), conn,
+ name);
+
+ info = purple_notify_user_info_new();
purple_notify_user_info_add_pair_plaintext(info, _("Information"), _("Retrieving..."));
uihandle = purple_notify_userinfo(conn, name, info, NULL, NULL);
purple_notify_user_info_destroy(info);
- purple_serv_get_info(conn, name);
return uihandle;
}
--- a/libpurple/account.c Thu Nov 17 23:38:41 2022 -0600
+++ b/libpurple/account.c Fri Nov 18 00:56:22 2022 -0600
@@ -335,11 +335,16 @@
static void
set_user_info_cb(PurpleAccount *account, const char *user_info)
{
- PurpleConnection *gc;
+ PurpleProtocol *protocol = NULL;
purple_account_set_user_info(account, user_info);
- gc = purple_account_get_connection(account);
- purple_serv_set_info(gc, user_info);
+
+ protocol = purple_account_get_protocol(account);
+ if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, set_info)) {
+ PurpleConnection *connection = purple_account_get_connection(account);
+ purple_protocol_server_set_info(PURPLE_PROTOCOL_SERVER(protocol),
+ connection, user_info);
+ }
}
static void
--- a/libpurple/protocols/jabber/buddy.c Thu Nov 17 23:38:41 2022 -0600
+++ b/libpurple/protocols/jabber/buddy.c Fri Nov 18 00:56:22 2022 -0600
@@ -559,6 +559,7 @@
{
PurpleXmlNode *vc_node;
PurpleRequestField *field;
+ PurpleProtocol *protocol = NULL;
const char *text;
char *p;
const struct vcard_template *vc_tp;
@@ -594,7 +595,11 @@
purple_xmlnode_free(vc_node);
purple_account_set_user_info(purple_connection_get_account(gc), p);
- purple_serv_set_info(gc, p);
+ protocol = purple_connection_get_protocol(gc);
+ if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, set_info)) {
+ purple_protocol_server_set_info(PURPLE_PROTOCOL_SERVER(protocol),
+ gc, p);
+ }
g_free(p);
}
--- a/libpurple/server.c Thu Nov 17 23:38:41 2022 -0600
+++ b/libpurple/server.c Fri Nov 18 00:56:22 2022 -0600
@@ -96,31 +96,6 @@
return val;
}
-void purple_serv_get_info(PurpleConnection *gc, const char *name)
-{
- PurpleProtocol *protocol;
-
- if (gc) {
- protocol = purple_connection_get_protocol(gc);
- purple_protocol_server_get_info(PURPLE_PROTOCOL_SERVER(protocol), gc,
- name);
- }
-}
-
-void purple_serv_set_info(PurpleConnection *gc, const char *info)
-{
- PurpleProtocol *protocol;
-
- if (gc) {
- protocol = purple_connection_get_protocol(gc);
-
- if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, set_info)) {
- purple_protocol_server_set_info(PURPLE_PROTOCOL_SERVER(protocol),
- gc, info);
- }
- }
-}
-
/*
* Set buddy's alias on server roster/list
*/
--- a/libpurple/server.h Thu Nov 17 23:38:41 2022 -0600
+++ b/libpurple/server.h Fri Nov 18 00:56:22 2022 -0600
@@ -76,24 +76,6 @@
*/
int purple_serv_send_im(PurpleConnection *gc, PurpleMessage *msg);
-/**
- * purple_serv_get_info:
- * @gc: The connection over which to send the typing notification.
- * @name: The name of the buddy we were asking information from.
- *
- * Request user information from the server.
- */
-void purple_serv_get_info(PurpleConnection *gc, const char *name);
-
-/**
- * purple_serv_set_info:
- * @gc: The connection over which to send the typing notification.
- * @info: Information text to be sent to the server.
- *
- * Set user account information on the server.
- */
-void purple_serv_set_info(PurpleConnection *gc, const char *info);
-
/******************************************************************************
* Chat Interface
*****************************************************************************/
--- a/pidgin/gtkutils.c Thu Nov 17 23:38:41 2022 -0600
+++ b/pidgin/gtkutils.c Fri Nov 18 00:56:22 2022 -0600
@@ -139,21 +139,26 @@
}
}
-static void
-show_retrieveing_info(PurpleConnection *conn, const char *name)
-{
- PurpleNotifyUserInfo *info = purple_notify_user_info_new();
- purple_notify_user_info_add_pair_plaintext(info, _("Information"), _("Retrieving..."));
+void
+pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) {
+ PurpleNotifyUserInfo *info = NULL;
+ PurpleProtocol *protocol = NULL;
+
+ protocol = purple_connection_get_protocol(conn);
+ if(!PURPLE_IS_PROTOCOL_SERVER(protocol)) {
+ return;
+ }
+
+ purple_protocol_server_get_info(PURPLE_PROTOCOL_SERVER(protocol), conn,
+ name);
+
+ info = purple_notify_user_info_new();
+ purple_notify_user_info_add_pair_plaintext(info, _("Information"),
+ _("Retrieving..."));
purple_notify_userinfo(conn, name, info, NULL, NULL);
purple_notify_user_info_destroy(info);
}
-void pidgin_retrieve_user_info(PurpleConnection *conn, const char *name)
-{
- show_retrieveing_info(conn, name);
- purple_serv_get_info(conn, name);
-}
-
void pidgin_retrieve_user_info_in_chat(PurpleConnection *conn, const char *name, int chat)
{
char *who = NULL;