libpurple/server.c

branch
release-2.x.y
changeset 40427
93bf0203f935
parent 38916
a2c4e6a21e21
child 40429
3d50e9e9e84d
--- a/libpurple/server.c	Wed May 20 11:33:10 2020 +0100
+++ b/libpurple/server.c	Wed May 20 11:33:58 2020 +0100
@@ -992,3 +992,19 @@
 			prpl_info->send_file(gc, who, file);
 	}
 }
+
+void serv_chat_send_file(PurpleConnection *gc, int id, const char *file)
+{
+	PurplePlugin *prpl;
+	PurplePluginProtocolInfo *prpl_info;
+
+	if (gc) {
+		prpl = purple_connection_get_prpl(gc);
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+
+		if (prpl_info->chat_send_file &&
+		    (!prpl_info->chat_can_receive_file
+		     || prpl_info->chat_can_receive_file(gc, id)))
+			prpl_info->chat_send_file(gc, id, file);
+	}
+}

mercurial