pidgin/pidgin

Send typing for tzc too.

2021-01-24, Arkadiy Illarionov
0ac1c00269b1
Parents e2f15b41266a
Children 1bad06536f81
Send typing for tzc too.

Testing Done:
Compile.

Reviewed at https://reviews.imfreedom.org/r/436/
--- a/libpurple/protocols/zephyr/zephyr.c Sun Jan 24 18:55:47 2021 -0600
+++ b/libpurple/protocols/zephyr/zephyr.c Sun Jan 24 18:55:53 2021 -0600
@@ -2132,33 +2132,36 @@
return "zephyr";
}
-static unsigned int zephyr_send_typing(PurpleProtocolIM *im, PurpleConnection *gc, const char *who, PurpleIMTypingState state) {
+static unsigned int
+zephyr_send_typing(G_GNUC_UNUSED PurpleProtocolIM *im, PurpleConnection *gc, const char *who, PurpleIMTypingState state)
+{
+ zephyr_account *zephyr;
gchar *recipient;
- zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
- if (use_tzc(zephyr))
+
+ if (state == PURPLE_IM_NOT_TYPING) {
return 0;
-
- if (state == PURPLE_IM_NOT_TYPING)
- return 0;
-
+ }
+
+ zephyr = purple_connection_get_protocol_data(gc);
/* XXX We probably should care if this fails. Or maybe we don't want to */
if (!who) {
purple_debug_info("zephyr", "who is null\n");
- recipient = local_zephyr_normalize(zephyr,"");
+ recipient = local_zephyr_normalize(zephyr, "");
} else {
char *comma = strrchr(who, ',');
/* Don't ping broadcast (chat) recipients */
/* The strrchr case finds a realm-stripped broadcast subscription
e.g. comma is the last character in the string */
- if (comma && ( (*(comma+1) == '\0') || (*(comma+1) == '@')))
+ if (comma && ((*(comma+1) == '\0') || (*(comma+1) == '@'))) {
return 0;
-
- recipient = local_zephyr_normalize(zephyr,who);
+ }
+
+ recipient = local_zephyr_normalize(zephyr, who);
}
- purple_debug_info("zephyr","about to send typing notification to %s\n",recipient);
- zephyr_send_message(zephyr,"MESSAGE","PERSONAL",recipient,"","","PING");
- purple_debug_info("zephyr","sent typing notification\n");
+ purple_debug_info("zephyr", "about to send typing notification to %s", recipient);
+ zephyr_send_message(zephyr, "MESSAGE", "PERSONAL", recipient, "", "", "PING");
+ purple_debug_info("zephyr", "sent typing notification\n");
/*
* TODO: Is this correct? It means we will call