pidgin/pidgin

4d9e01eb0560
Parents 36610b5bd662
Children d122647268be
Update the demo protocol plugint to not use serv_got_im

serv_got_im is going away so this needs to stop using it. For the interim, I
just made is use g_warning instead.

Testing Done:
Ran the turtles and built on top of a branch that's removing a lot of the old im stuff.

Reviewed at https://reviews.imfreedom.org/r/3107/
--- a/protocols/demo/purpledemoprotocolmedia.c Sat Apr 13 19:06:12 2024 -0500
+++ b/protocols/demo/purpledemoprotocolmedia.c Sat Apr 13 19:42:52 2024 -0500
@@ -39,28 +39,14 @@
static gboolean
purple_demo_protocol_media_initiate_session(G_GNUC_UNUSED PurpleProtocolMedia *media,
- PurpleAccount *account,
- const gchar *who,
+ G_GNUC_UNUSED PurpleAccount *account,
+ const char *who,
PurpleMediaSessionType type)
{
- PurpleConnection *connection = NULL;
gchar *session_name = NULL;
- gchar *message = NULL;
- GDateTime *timestamp = NULL;
-
- connection = purple_account_get_connection(account);
session_name = g_flags_to_string(PURPLE_MEDIA_TYPE_SESSION_TYPE, type);
- message = g_strdup_printf(_("Initiated demo %s session with %s"),
- session_name, who);
- timestamp = g_date_time_new_now_utc();
-
- purple_serv_got_im(connection, "Echo",
- message, PURPLE_MESSAGE_RECV,
- g_date_time_to_unix(timestamp));
-
- g_date_time_unref(timestamp);
- g_free(message);
+ g_warning(_("Initiated demo %s session with %s"), session_name, who);
g_free(session_name);
/* TODO: When libpurple gets a backend, we can implement more of this. */
@@ -69,27 +55,12 @@
static gboolean
purple_demo_protocol_media_send_dtmf(G_GNUC_UNUSED PurpleProtocolMedia *protocol_media,
- PurpleMedia *media, gchar dtmf,
+ G_GNUC_UNUSED PurpleMedia *media,
+ char dtmf,
guint8 volume, guint8 duration)
{
- PurpleAccount *account = NULL;
- PurpleConnection *connection = NULL;
- gchar *message = NULL;
- GDateTime *timestamp = NULL;
-
- account = purple_media_get_account(media);
- connection = purple_account_get_connection(account);
-
- message = g_strdup_printf(_("Received DTMF %c at volume %d for %d seconds"),
- dtmf, volume, duration);
- timestamp = g_date_time_new_now_utc();
-
- purple_serv_got_im(connection, "Echo",
- message, PURPLE_MESSAGE_RECV,
- g_date_time_to_unix(timestamp));
-
- g_date_time_unref(timestamp);
- g_free(message);
+ g_warning(_("Received DTMF %c at volume %d for %d seconds"),
+ dtmf, volume, duration);
return TRUE;
}