pidgin/pidgin

Merge upstream, resolve conflicts

16 months ago, qarkai
00a9ef389aab
Merge upstream, resolve conflicts
  • +7 -0
    ChangeLog.API
  • +0 -2
    finch/gntblist.c
  • +2 -2
    finch/gntrequest.c
  • +0 -1
    finch/plugins/gntclipboard.c
  • +1 -3
    libpurple/buddylist.c
  • +1 -1
    libpurple/core.c
  • +2 -1
    libpurple/image-store.c
  • +1 -2
    libpurple/keyring.c
  • +5 -7
    libpurple/log.c
  • +59 -0
    libpurple/network.c
  • +18 -0
    libpurple/network.h
  • +2 -1
    libpurple/plugins/autoaccept.c
  • +1 -1
    libpurple/plugins/keyrings/internalkeyring.c
  • +76 -71
    libpurple/plugins/log_reader.c
  • +1 -1
    libpurple/presence.c
  • +1 -1
    libpurple/protocols.c
  • +2 -5
    libpurple/protocols/bonjour/bonjour_ft.c
  • +1 -1
    libpurple/protocols/bonjour/mdns_dns_sd.c
  • +1 -1
    libpurple/protocols/facebook/api.c
  • +1 -1
    libpurple/protocols/gg/blist.c
  • +1 -1
    libpurple/protocols/gg/blist.h
  • +8 -9
    libpurple/protocols/gg/edisc.c
  • +0 -2
    libpurple/protocols/irc/cmds.c
  • +3 -8
    libpurple/protocols/irc/msgs.c
  • +12 -1
    libpurple/protocols/jabber/auth_cyrus.c
  • +0 -6
    libpurple/protocols/jabber/bosh.c
  • +0 -1
    libpurple/protocols/jabber/google/gmail.c
  • +1 -1
    libpurple/protocols/jabber/google/google_presence.c
  • +246 -291
    libpurple/protocols/jabber/jabber.c
  • +5 -5
    libpurple/protocols/jabber/jabber.h
  • +3 -0
    libpurple/protocols/jabber/namespaces.h
  • +9 -4
    libpurple/protocols/jabber/si.c
  • +130 -160
    libpurple/protocols/novell/nmconn.c
  • +16 -70
    libpurple/protocols/novell/nmconn.h
  • +217 -75
    libpurple/protocols/novell/nmevent.c
  • +45 -34
    libpurple/protocols/novell/nmuser.c
  • +1 -0
    libpurple/protocols/novell/nmuser.h
  • +44 -35
    libpurple/protocols/novell/novell.c
  • +5 -4
    libpurple/protocols/sametime/sametime.c
  • +1 -1
    libpurple/protocols/silc/ops.c
  • +68 -52
    libpurple/protocols/silc/silc.c
  • +3 -3
    libpurple/protocols/silc/silcpurple.h
  • +1 -3
    libpurple/protocols/simple/simple.c
  • +0 -1
    libpurple/protocols/zephyr/Zinternal.c
  • +0 -22
    libpurple/protocols/zephyr/zephyr.c
  • +3 -3
    libpurple/upnp.c
  • +1 -490
    libpurple/util.c
  • +0 -130
    libpurple/util.h
  • +1 -1
    meson.build
  • +2 -1
    pidgin/gtkblist.c
  • +3 -3
    pidgin/gtkconv.c
  • +2 -1
    pidgin/gtkdialogs.c
  • +2 -4
    pidgin/gtknotify.c
  • +12 -8
    pidgin/gtkprefs.c
  • +1 -2
    pidgin/gtkrequest.c
  • +7 -12
    pidgin/gtkutils.c
  • +3 -2
    pidgin/gtkxfer.c
  • +1 -1
    pidgin/libpidgin.c
  • +1 -1
    pidgin/pidgincontactcompletion.c
  • +2 -0
    pidgin/pidgintooltip.c
  • +0 -1
    pidgin/plugins/spellchk.c
  • --- a/ChangeLog.API Mon Nov 04 10:00:14 2019 +0300
    +++ b/ChangeLog.API Mon Nov 04 14:43:49 2019 +0300
    @@ -393,6 +393,7 @@
    * purple_buddy_icons_has_custom_icon
    * purple_buddy_icons_find_custom_icon
    * purple_buddy_icons_set_custom_icon
    + * purple_build_dir. Use g_mkdir_with_parents instead
    * purple_certificate_check_signature_chain_with_failing. Use
    purple_certificate_check_signature_chain, instead
    * purple_certificate_display_x509. Use purple_request_certificate,
    @@ -416,10 +417,12 @@
    event loop yourself. See GLib Main Event Loop docs.
    * PurpleEventLoopUiOps. Manually drive the GLib event loop
    yourself. See GLib Main Event Loop docs.
    + * purple_get_host_name. Use g_get_host_name, instead.
    * purple_get_tzoff_str(). Use g_date_time_format, instead.
    * purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
    purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
    or #GInetAddress instead.
    + * purple_markup_extract_info_field
    * PurpleMimeDocument, PurpleMimePart,
    purple_mime_document_new, purple_mime_document_free,
    purple_mime_document_parse, purple_mime_document_parsen,
    @@ -496,6 +499,9 @@
    * purple_status_type_set_primary_attr
    * purple_strlcat
    * purple_strlcpy
    + * purple_str_binary_to_ascii
    + * purple_str_has_prefix. Use g_str_has_prefix instead
    + * purple_str_has_suffix. Use g_str_has_suffix instead
    * purple_str_size_to_units. Use g_format_size() instead.
    * purple_timeout_*. Use g_timeout_* or g_idle_* instead.
    * purple_txt_cancel
    @@ -508,6 +514,7 @@
    purple_util_fetch_url_request, instead.
    * purple_util_get_image_checksum. Use
    g_compute_checksum_for_data(G_CHECKSUM_SHA1, ...), instead.
    + * purple_uts35_to_str
    * PurpleCertificateVerificationStatus.PURPLE_CERTIFICATE_INVALID
    * PurpleConnectionUiOps.report_disconnect_reason
    * PurplePluginProtocolInfo.add_buddy_with_invite
    --- a/finch/gntblist.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/finch/gntblist.c Mon Nov 04 14:43:49 2019 +0300
    @@ -2066,8 +2066,6 @@
    PURPLE_SIGNAL_PRIORITY_HIGHEST);
    finch_blist_install_manager(&default_manager);
    -
    - return;
    }
    static gboolean
    --- a/finch/gntrequest.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/finch/gntrequest.c Mon Nov 04 14:43:49 2019 +0300
    @@ -433,9 +433,9 @@
    purple_request_field_string_get_default_value(field));
    gnt_entry_set_masked(GNT_ENTRY(entry),
    purple_request_field_string_is_masked(field));
    - if (hint && purple_str_has_prefix(hint, "screenname")) {
    + if (hint && g_str_has_prefix(hint, "screenname")) {
    PurpleBlistNode *node = purple_blist_get_default_root();
    - gboolean offline = purple_str_has_suffix(hint, "all");
    + gboolean offline = g_str_has_suffix(hint, "all");
    for (; node; node = purple_blist_node_next(node, offline)) {
    if (!PURPLE_IS_BUDDY(node))
    continue;
    --- a/finch/plugins/gntclipboard.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/finch/plugins/gntclipboard.c Mon Nov 04 14:43:49 2019 +0300
    @@ -90,7 +90,6 @@
    return;
    }
    }
    - return;
    }
    static void
    --- a/libpurple/buddylist.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/buddylist.c Mon Nov 04 14:43:49 2019 +0300
    @@ -727,9 +727,7 @@
    buddies_cache = g_hash_table_new_full(g_direct_hash, g_direct_equal,
    NULL, (GDestroyNotify)g_hash_table_destroy);
    - groups_cache = g_hash_table_new_full((GHashFunc)g_str_hash,
    - (GEqualFunc)g_str_equal,
    - (GDestroyNotify)g_free, NULL);
    + groups_cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
    for (account = purple_accounts_get_all(); account != NULL; account = account->next)
    {
    --- a/libpurple/core.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/core.c Mon Nov 04 14:43:49 2019 +0300
    @@ -249,7 +249,7 @@
    purple_log_uninit();
    _purple_message_uninit();
    /* Everything after util_uninit cannot try to write things to the
    - * confdir nor use purple_escape_js
    + * confdir.
    */
    purple_util_uninit();
    --- a/libpurple/image-store.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/image-store.c Mon Nov 04 14:43:49 2019 +0300
    @@ -169,8 +169,9 @@
    g_return_val_if_fail(uri != NULL, NULL);
    - if (!purple_str_has_prefix(uri, PURPLE_IMAGE_STORE_PROTOCOL))
    + if (!g_str_has_prefix(uri, PURPLE_IMAGE_STORE_PROTOCOL)) {
    return NULL;
    + }
    uri += sizeof(PURPLE_IMAGE_STORE_PROTOCOL) - 1;
    if (uri[0] == '-')
    --- a/libpurple/keyring.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/keyring.c Mon Nov 04 14:43:49 2019 +0300
    @@ -1287,8 +1287,7 @@
    GPluginPluginInfo *info =
    GPLUGIN_PLUGIN_INFO(purple_plugin_get_info(plugin));
    - if (!purple_str_has_prefix(gplugin_plugin_info_get_id(info),
    - "keyring-")) {
    + if (!g_str_has_prefix(gplugin_plugin_info_get_id(info), "keyring-")) {
    continue;
    }
    --- a/libpurple/log.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/log.c Mon Nov 04 14:43:49 2019 +0300
    @@ -871,7 +871,7 @@
    if (dir == NULL)
    return;
    - purple_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
    + g_mkdir_with_parents(dir, S_IRUSR | S_IWUSR | S_IXUSR);
    dt = g_date_time_to_local(log->time);
    tz = purple_escape_filename(g_date_time_get_timezone_abbreviation(dt));
    @@ -927,9 +927,8 @@
    while ((filename = g_dir_read_name(dir)))
    {
    - if (purple_str_has_suffix(filename, ext) &&
    - strlen(filename) >= (17 + strlen(ext)))
    - {
    + if (g_str_has_suffix(filename, ext) &&
    + strlen(filename) >= (17 + strlen(ext))) {
    PurpleLog *log;
    PurpleLogCommonLoggerData *data;
    GDateTime *stamp = purple_str_to_date_time(purple_unescape_filename(filename), FALSE);
    @@ -971,9 +970,8 @@
    while ((filename = g_dir_read_name(dir)))
    {
    - if (purple_str_has_suffix(filename, ext) &&
    - strlen(filename) >= (17 + strlen(ext)))
    - {
    + if (g_str_has_suffix(filename, ext) &&
    + strlen(filename) >= (17 + strlen(ext))) {
    char *tmp = g_build_filename(path, filename, NULL);
    GStatBuf st;
    if (g_stat(tmp, &st))
    --- a/libpurple/network.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/network.c Mon Nov 04 14:43:49 2019 +0300
    @@ -150,6 +150,29 @@
    return "0.0.0.0";
    }
    +static gchar *
    +purple_network_get_local_system_ip_from_gio(GSocketConnection *sockconn)
    +{
    + GSocketAddress *addr;
    + GInetSocketAddress *inetsockaddr;
    + gchar *ip;
    +
    + addr = g_socket_connection_get_local_address(sockconn, NULL);
    + if ((inetsockaddr = G_INET_SOCKET_ADDRESS(addr)) != NULL) {
    + GInetAddress *inetaddr =
    + g_inet_socket_address_get_address(inetsockaddr);
    + if (g_inet_address_get_family(inetaddr) == G_SOCKET_FAMILY_IPV4 &&
    + !g_inet_address_get_is_loopback(inetaddr)) {
    + ip = g_inet_address_to_string(inetaddr);
    + g_object_unref(addr);
    + return ip;
    + }
    + }
    + g_object_unref(addr);
    +
    + return g_strdup("0.0.0.0");
    +}
    +
    GList *
    purple_network_get_all_local_system_ips(void)
    {
    @@ -286,6 +309,42 @@
    return purple_network_get_local_system_ip(fd);
    }
    +gchar *
    +purple_network_get_my_ip_from_gio(GSocketConnection *sockconn)
    +{
    + const gchar *ip = NULL;
    + PurpleStunNatDiscovery *stun;
    +
    + /* Check if the user specified an IP manually */
    + if (!purple_prefs_get_bool("/purple/network/auto_ip")) {
    + ip = purple_network_get_public_ip();
    + /* Make sure the IP address entered by the user is valid */
    + if ((ip != NULL) && (purple_network_is_ipv4(ip))) {
    + return g_strdup(ip);
    + }
    + } else {
    + /* Check if STUN discovery was already done */
    + stun = purple_stun_discover(NULL);
    + if ((stun != NULL) && (stun->status == PURPLE_STUN_STATUS_DISCOVERED)) {
    + return g_strdup(stun->publicip);
    + }
    +
    + /* Attempt to get the IP from a NAT device using UPnP */
    + ip = purple_upnp_get_public_ip();
    + if (ip != NULL) {
    + return g_strdup(ip);
    + }
    +
    + /* Attempt to get the IP from a NAT device using NAT-PMP */
    + ip = purple_pmp_get_public_ip();
    + if (ip != NULL) {
    + return g_strdup(ip);
    + }
    + }
    +
    + /* Just fetch the IP of the local system */
    + return purple_network_get_local_system_ip_from_gio(sockconn);
    +}
    static void
    purple_network_set_upnp_port_mapping_cb(gboolean success, gpointer data)
    --- a/libpurple/network.h Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/network.h Mon Nov 04 14:43:49 2019 +0300
    @@ -29,6 +29,7 @@
    */
    #include <glib.h>
    +#include <gio/gio.h>
    G_BEGIN_DECLS
    @@ -113,6 +114,23 @@
    const char *purple_network_get_my_ip(int fd);
    /**
    + * purple_network_get_my_ip_from_gio:
    + * @sockconn: The socket connection to use to help figure out the IP, or %NULL.
    + *
    + * Returns the IP address that should be used anywhere a
    + * public IP addresses is needed (listening for an incoming
    + * file transfer, etc).
    + *
    + * If the user has manually specified an IP address via
    + * preferences, then this IP is returned. Otherwise the
    + * IP address returned by purple_network_get_local_system_ip_from_gio()
    + * is returned.
    + *
    + * Returns: The local IP address to be used.
    + */
    +gchar *purple_network_get_my_ip_from_gio(GSocketConnection *sockconn);
    +
    +/**
    * purple_network_listen:
    * @port: The port number to bind to. Must be greater than 0.
    * @socket_family: The protocol family of the socket. This should be
    --- a/libpurple/plugins/autoaccept.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/plugins/autoaccept.c Mon Nov 04 14:43:49 2019 +0300
    @@ -54,8 +54,9 @@
    {
    if (!g_file_test(dir, G_FILE_TEST_IS_DIR))
    {
    - if (purple_build_dir(dir, S_IRUSR | S_IWUSR | S_IXUSR))
    + if (g_mkdir_with_parents(dir, S_IRUSR | S_IWUSR | S_IXUSR)) {
    return FALSE;
    + }
    }
    return TRUE;
    --- a/libpurple/plugins/keyrings/internalkeyring.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/plugins/keyrings/internalkeyring.c Mon Nov 04 14:43:49 2019 +0300
    @@ -849,7 +849,7 @@
    *mode = "ciphertext";
    *data = ciphertext;
    - *destroy = (GDestroyNotify)g_free;
    + *destroy = g_free;
    return TRUE;
    }
    --- a/libpurple/plugins/log_reader.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/plugins/log_reader.c Mon Nov 04 14:43:49 2019 +0300
    @@ -100,9 +100,11 @@
    const gchar *file;
    while ((file = g_dir_read_name(dir))) {
    - if (!purple_str_has_prefix(file, sn))
    + if (!g_str_has_prefix(file, sn)) {
    continue;
    - if (purple_str_has_suffix(file, ".html") || purple_str_has_suffix(file, ".AdiumHTMLLog")) {
    + }
    + if (g_str_has_suffix(file, ".html") ||
    + g_str_has_suffix(file, ".AdiumHTMLLog")) {
    GDateTime *dt;
    gint year, month, day, hour, minute, second;
    const char *date = file;
    @@ -165,7 +167,7 @@
    list = g_list_prepend(list, log);
    }
    - } else if (purple_str_has_suffix(file, ".adiumLog")) {
    + } else if (g_str_has_suffix(file, ".adiumLog")) {
    GDateTime *dt;
    gint year, month, day, hour, minute, second;
    const char *date = file;
    @@ -269,8 +271,7 @@
    /* This problem only seems to show up on Windows.
    * The BOM is displaying as a space at the beginning of the log.
    */
    - if (purple_str_has_prefix(read, "\xef\xbb\xbf"))
    - {
    + if (g_str_has_prefix(read, "\xef\xbb\xbf")) {
    /* FIXME: This feels so wrong... */
    char *temp = g_strdup(&(read[3]));
    g_free(read);
    @@ -578,8 +579,9 @@
    while ((name = g_dir_read_name(dir))) {
    const char *c = name;
    - if (!purple_str_has_prefix(c, username))
    + if (!g_str_has_prefix(c, username)) {
    continue;
    + }
    c += strlen(username);
    while (*c) {
    @@ -631,8 +633,9 @@
    const char *c = name;
    gchar *full_path;
    - if (!purple_str_has_prefix(c, username))
    + if (!g_str_has_prefix(c, username)) {
    continue;
    + }
    c += strlen(username);
    while (*c) {
    @@ -862,16 +865,18 @@
    * friendly name or alias. For this test, "match" is defined as:
    * ^(friendly_name|alias)([^a-zA-Z0-9].*)?$
    */
    - from_name_matches = (purple_str_has_prefix(from_name, friendly_name) &&
    - !isalnum(*(from_name + friendly_name_length))) ||
    - (purple_str_has_prefix(from_name, alias) &&
    - !isalnum(*(from_name + alias_length)));
    -
    - to_name_matches = to_name != NULL && (
    - (purple_str_has_prefix(to_name, friendly_name) &&
    - !isalnum(*(to_name + friendly_name_length))) ||
    - (purple_str_has_prefix(to_name, alias) &&
    - !isalnum(*(to_name + alias_length))));
    + from_name_matches =
    + (g_str_has_prefix(from_name, friendly_name) &&
    + !isalnum(*(from_name + friendly_name_length))) ||
    + (g_str_has_prefix(from_name, alias) &&
    + !isalnum(*(from_name + alias_length)));
    +
    + to_name_matches =
    + to_name != NULL &&
    + ((g_str_has_prefix(to_name, friendly_name) &&
    + !isalnum(*(to_name + friendly_name_length))) ||
    + (g_str_has_prefix(to_name, alias) &&
    + !isalnum(*(to_name + alias_length))));
    if (from_name_matches) {
    if (!to_name_matches) {
    @@ -901,15 +906,13 @@
    * matches their alias. For this test, "match" is
    * defined as: ^alias([^a-zA-Z0-9].*)?$
    */
    - from_name_matches = (purple_str_has_prefix(
    - from_name, alias) &&
    - !isalnum(*(from_name +
    - alias_length)));
    -
    - to_name_matches = to_name && (purple_str_has_prefix(
    - to_name, alias) &&
    - !isalnum(*(to_name +
    - alias_length)));
    + from_name_matches =
    + (g_str_has_prefix(from_name, alias) &&
    + !isalnum(*(from_name + alias_length)));
    +
    + to_name_matches = to_name &&
    + (g_str_has_prefix(to_name, alias) &&
    + !isalnum(*(to_name + alias_length)));
    g_free(alias);
    @@ -929,17 +932,17 @@
    * this test, "match" is defined as:
    * ^friendly_name([^a-zA-Z0-9].*)?$
    */
    - from_name_matches = (purple_str_has_prefix(
    - from_name,
    - server_alias) &&
    - !isalnum(*(from_name +
    - friendly_name_length)));
    -
    - to_name_matches = to_name && (
    - (purple_str_has_prefix(
    - to_name, server_alias) &&
    - !isalnum(*(to_name +
    - friendly_name_length))));
    + from_name_matches =
    + (g_str_has_prefix(from_name,
    + server_alias) &&
    + !isalnum(*(from_name +
    + friendly_name_length)));
    +
    + to_name_matches =
    + to_name &&
    + ((g_str_has_prefix(to_name, server_alias) &&
    + !isalnum(*(to_name +
    + friendly_name_length))));
    if (from_name_matches) {
    if (!to_name_matches) {
    @@ -1142,7 +1145,7 @@
    }
    *c = '\0';
    - if (purple_str_has_prefix(line, "Session Close ")) {
    + if (g_str_has_prefix(line, "Session Close ")) {
    if (data && !data->length) {
    if (!(data->length = last_line_offset - data->offset)) {
    /* This log had no data, so we remove it. */
    @@ -1156,7 +1159,7 @@
    }
    }
    } else if (line[0] && line[1] && line[2] &&
    - purple_str_has_prefix(&line[3], "sion Start ")) {
    + g_str_has_prefix(&line[3], "sion Start ")) {
    /* The conditional is to make sure we're not reading off
    * the end of the string. We don't want strlen(), as that'd
    * have to count the whole string needlessly.
    @@ -1418,17 +1421,18 @@
    line++;
    }
    - if (purple_str_has_prefix(line, "*** ")) {
    + if (g_str_has_prefix(line, "*** ")) {
    line += (sizeof("*** ") - 1);
    g_string_append(formatted, "<b>");
    footer = "</b>";
    - if (purple_str_has_prefix(line, "NOTE: This user is offline.")) {
    + if (g_str_has_prefix(line, "NOTE: This user is offline.")) {
    line = _("User is offline.");
    - } else if (purple_str_has_prefix(line,
    - "NOTE: Your status is currently set to ")) {
    + } else if (g_str_has_prefix(
    + line,
    + "NOTE: Your status is currently set to ")) {
    line += (sizeof("NOTE: ") - 1);
    - } else if (purple_str_has_prefix(line, "Auto-response sent to ")) {
    + } else if (g_str_has_prefix(line, "Auto-response sent to ")) {
    g_string_append(formatted, _("Auto-response sent:"));
    while (*line && *line != ':')
    line++;
    @@ -1462,8 +1466,8 @@
    g_string_append(formatted, log->name);
    line = " logged in.";
    - } else if (purple_str_has_prefix(line,
    - "One or more messages may have been undeliverable.")) {
    + } else if (g_str_has_prefix(line, "One or more messages may "
    + "have been undeliverable.")) {
    g_string_append(formatted,
    "<span style=\"color: #ff0000;\">");
    @@ -1472,8 +1476,8 @@
    "undeliverable."));
    line = "";
    footer = "</span></b>";
    - } else if (purple_str_has_prefix(line,
    - "You have been disconnected.")) {
    + } else if (g_str_has_prefix(line,
    + "You have been disconnected.")) {
    g_string_append(formatted,
    "<span style=\"color: #ff0000;\">");
    @@ -1481,8 +1485,8 @@
    _("You were disconnected from the server."));
    line = "";
    footer = "</span></b>";
    - } else if (purple_str_has_prefix(line,
    - "You are currently disconnected.")) {
    + } else if (g_str_has_prefix(
    + line, "You are currently disconnected.")) {
    g_string_append(formatted,
    "<span style=\"color: #ff0000;\">");
    @@ -1490,15 +1494,16 @@
    "will not be received unless you are "
    "logged in.");
    footer = "</span></b>";
    - } else if (purple_str_has_prefix(line,
    - "Your previous message has not been sent.")) {
    + } else if (g_str_has_prefix(line, "Your previous message has "
    + "not been sent.")) {
    g_string_append(formatted,
    "<span style=\"color: #ff0000;\">");
    - if (purple_str_has_prefix(line,
    - "Your previous message has not been sent. "
    - "Reason: Maximum length exceeded.")) {
    + if (g_str_has_prefix(
    + line,
    + "Your previous message has not been sent. "
    + "Reason: Maximum length exceeded.")) {
    g_string_append(formatted,
    _("Message could not be sent because "
    @@ -1514,7 +1519,7 @@
    footer = "</span></b>";
    }
    - } else if (purple_str_has_prefix(line, data->their_nickname)) {
    + } else if (g_str_has_prefix(line, data->their_nickname)) {
    if (buddy != NULL) {
    const char *alias = purple_buddy_get_alias(buddy);
    @@ -1684,8 +1689,8 @@
    gboolean add_new_log = FALSE;
    if (c && *c) {
    - if (purple_str_has_prefix(c, QIP_LOG_IN_MESSAGE) ||
    - purple_str_has_prefix(c, QIP_LOG_OUT_MESSAGE)) {
    + if (g_str_has_prefix(c, QIP_LOG_IN_MESSAGE) ||
    + g_str_has_prefix(c, QIP_LOG_OUT_MESSAGE)) {
    char *tmp;
    @@ -1841,12 +1846,12 @@
    while (c && *c) {
    gboolean is_in_message = FALSE;
    - if (purple_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC) ||
    - purple_str_has_prefix(line, QIP_LOG_OUT_MESSAGE_ESC)) {
    + if (g_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC) ||
    + g_str_has_prefix(line, QIP_LOG_OUT_MESSAGE_ESC)) {
    char *tmp;
    - is_in_message = purple_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC);
    + is_in_message = g_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC);
    /* find EOL */
    c = strchr(c, '\n');
    @@ -2010,7 +2015,7 @@
    gint year, month, day, hour, minute, second;
    GDateTime *dt;
    while (c && *c) {
    - if (purple_str_has_prefix(c, AMSN_LOG_CONV_START)) {
    + if (g_str_has_prefix(c, AMSN_LOG_CONV_START)) {
    char month_str[4];
    if (sscanf(c + strlen(AMSN_LOG_CONV_START),
    "%u %3s %u %u:%u:%u",
    @@ -2027,7 +2032,7 @@
    offset = c - contents;
    start_log = c;
    }
    - } else if (purple_str_has_prefix(c, AMSN_LOG_CONV_END) && found_start) {
    + } else if (g_str_has_prefix(c, AMSN_LOG_CONV_END) && found_start) {
    data = g_new0(struct amsn_logger_data, 1);
    data->path = g_strdup(filename);
    data->offset = offset;
    @@ -2215,7 +2220,7 @@
    if (!end)
    break;
    *end = '\0';
    - if (purple_str_has_prefix(start, AMSN_LOG_FORMAT_TAG) && in_span) {
    + if (g_str_has_prefix(start, AMSN_LOG_FORMAT_TAG) && in_span) {
    /* New format for this line */
    g_string_append(formatted, "</span><br>");
    in_span = FALSE;
    @@ -2244,19 +2249,19 @@
    old_tag = tag + 7; /* C + xxxxxx */
    } else {
    /* |"Lxxx is a 3-digit colour code */
    - if (purple_str_has_prefix(tag, "RED")) {
    + if (g_str_has_prefix(tag, "RED")) {
    g_string_append(formatted, "<span style=\"color: red;\">");
    in_span = TRUE;
    - } else if (purple_str_has_prefix(tag, "GRA")) {
    + } else if (g_str_has_prefix(tag, "GRA")) {
    g_string_append(formatted, "<span style=\"color: gray;\">");
    in_span = TRUE;
    - } else if (purple_str_has_prefix(tag, "NOR")) {
    + } else if (g_str_has_prefix(tag, "NOR")) {
    g_string_append(formatted, "<span style=\"color: black;\">");
    in_span = TRUE;
    - } else if (purple_str_has_prefix(tag, "ITA")) {
    + } else if (g_str_has_prefix(tag, "ITA")) {
    g_string_append(formatted, "<span style=\"color: blue;\">");
    in_span = TRUE;
    - } else if (purple_str_has_prefix(tag, "GRE")) {
    + } else if (g_str_has_prefix(tag, "GRE")) {
    g_string_append(formatted, "<span style=\"color: darkgreen;\">");
    in_span = TRUE;
    } else {
    @@ -2429,7 +2434,7 @@
    *temp = '\0';
    /* Set path. */
    - if (purple_str_has_suffix(value, "trillian.exe")) {
    + if (g_str_has_suffix(value, "trillian.exe")) {
    value[strlen(value) - (sizeof("trillian.exe") - 1)] = '\0';
    path = g_build_filename(value, "users", "default", "talk.ini", NULL);
    }
    @@ -2472,7 +2477,7 @@
    *cursor = '\0';
    /* XXX: This assumes the first Directory key is under [Logging]. */
    - if (purple_str_has_prefix(line, "Directory=")) {
    + if (g_str_has_prefix(line, "Directory=")) {
    line += (sizeof("Directory=") - 1);
    g_strchomp(line);
    purple_prefs_add_string(
    --- a/libpurple/presence.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/presence.c Mon Nov 04 14:43:49 2019 +0300
    @@ -462,7 +462,7 @@
    purple_presence_get_instance_private(PURPLE_PRESENCE(object));
    if (priv->statuses) {
    - g_list_free_full(priv->statuses, (GDestroyNotify)g_object_unref);
    + g_list_free_full(priv->statuses, g_object_unref);
    priv->statuses = NULL;
    }
    --- a/libpurple/protocols.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols.c Mon Nov 04 14:43:49 2019 +0300
    @@ -690,7 +690,7 @@
    void *handle = purple_protocols_get_handle();
    protocols = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
    - (GDestroyNotify)g_object_unref);
    + g_object_unref);
    purple_signal_register(handle, "protocol-added",
    purple_marshal_VOID__POINTER,
    --- a/libpurple/protocols/bonjour/bonjour_ft.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols/bonjour/bonjour_ft.c Mon Nov 04 14:43:49 2019 +0300
    @@ -33,7 +33,7 @@
    bonjour_xfer_init(PurpleXfer *xfer);
    static void
    bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid, const char *from,
    - const goffset filesize, const char *filename, int option);
    + goffset filesize, const char *filename, int option);
    /* Look for specific xfer handle */
    static unsigned int next_id = 0;
    @@ -727,7 +727,7 @@
    static void
    bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid, const char *from,
    - const goffset filesize, const char *filename, int option)
    + goffset filesize, const char *filename, int option)
    {
    PurpleXfer *xfer;
    XepXfer *xf;
    @@ -877,7 +877,6 @@
    default:
    break;
    }
    - return;
    }
    static void
    @@ -943,8 +942,6 @@
    bonjour_bytestreams_listen, xfer);
    if (xf->listen_data == NULL)
    purple_xfer_cancel_local(xfer);
    -
    - return;
    }
    static void
    --- a/libpurple/protocols/bonjour/mdns_dns_sd.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols/bonjour/mdns_dns_sd.c Mon Nov 04 14:43:49 2019 +0300
    @@ -460,7 +460,7 @@
    gboolean _mdns_init_session(BonjourDnsSd *data) {
    data->mdns_impl_data = g_new0(Win32SessionImplData, 1);
    - bonjour_dns_sd_set_jid(data->account, purple_get_host_name());
    + bonjour_dns_sd_set_jid(data->account, g_get_host_name());
    return TRUE;
    }
    --- a/libpurple/protocols/facebook/api.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols/facebook/api.c Mon Nov 04 14:43:49 2019 +0300
    @@ -2339,7 +2339,7 @@
    g_signal_emit_by_name(api, "contacts-delta", added, removed);
    g_slist_free_full(added, (GDestroyNotify) fb_api_user_free);
    - g_slist_free_full(removed, (GDestroyNotify) g_free);
    + g_slist_free_full(removed, g_free);
    g_list_free(elms);
    json_array_unref(arr);
    --- a/libpurple/protocols/gg/blist.c Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols/gg/blist.c Mon Nov 04 14:43:49 2019 +0300
    @@ -187,7 +187,7 @@
    }
    /* }}} */
    -const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, const uin_t uin)
    +const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, uin_t uin)
    {
    const char *uin_s = ggp_uin_to_str(uin);
    PurpleBuddy *buddy = purple_blist_find_buddy(
    --- a/libpurple/protocols/gg/blist.h Mon Nov 04 10:00:14 2019 +0300
    +++ b/libpurple/protocols/gg/blist.h Mon Nov 04 14:43:49 2019 +0300