--- a/libpurple/plugins/log_reader.c Mon Nov 04 02:22:52 2019 -0500
+++ b/libpurple/plugins/log_reader.c Mon Nov 04 02:36:50 2019 -0500
@@ -100,9 +100,11 @@
while ((file = g_dir_read_name(dir))) {
- if (!purple_str_has_prefix(file, sn))
+ if (!g_str_has_prefix(file, sn)) { - 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")) { gint year, month, day, hour, minute, second;
@@ -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")) { gint year, month, day, hour, minute, second;
@@ -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]));
@@ -578,8 +579,9 @@
while ((name = g_dir_read_name(dir))) {
- if (!purple_str_has_prefix(c, username))
+ if (!g_str_has_prefix(c, username)) { @@ -631,8 +633,9 @@
- if (!purple_str_has_prefix(c, username))
+ if (!g_str_has_prefix(c, username)) { @@ -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))));
+ (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))); + ((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)))); @@ -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(
- to_name_matches = to_name && (purple_str_has_prefix(
+ (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))); @@ -929,17 +932,17 @@
* this test, "match" is defined as:
* ^friendly_name([^a-zA-Z0-9].*)?$
- from_name_matches = (purple_str_has_prefix(
- friendly_name_length)));
- to_name_matches = to_name && (
- (purple_str_has_prefix(
- to_name, server_alias) &&
- friendly_name_length))));
+ (g_str_has_prefix(from_name, + friendly_name_length))); + ((g_str_has_prefix(to_name, server_alias) && + friendly_name_length)))); @@ -1142,7 +1145,7 @@
- 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 @@
- if (purple_str_has_prefix(line, "*** ")) {
+ if (g_str_has_prefix(line, "*** ")) { line += (sizeof("*** ") - 1);
g_string_append(formatted, "<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( + "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 != ':')
@@ -1462,8 +1466,8 @@
g_string_append(formatted, log->name);
- } 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 @@
- } 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."));
- } 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 "
- } 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 " 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.")) {
+ "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 @@
- } else if (purple_str_has_prefix(line, data->their_nickname)) {
+ } else if (g_str_has_prefix(line, data->their_nickname)) { const char *alias = purple_buddy_get_alias(buddy);
@@ -1684,8 +1689,8 @@
gboolean add_new_log = FALSE;
- 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)) { @@ -1841,12 +1846,12 @@
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)) { - 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); @@ -2010,7 +2015,7 @@
gint year, month, day, hour, minute, second;
- if (purple_str_has_prefix(c, AMSN_LOG_CONV_START)) {
+ if (g_str_has_prefix(c, AMSN_LOG_CONV_START)) { if (sscanf(c + strlen(AMSN_LOG_CONV_START),
@@ -2027,7 +2032,7 @@
- } 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);
@@ -2215,7 +2220,7 @@
- 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>");
@@ -2244,19 +2249,19 @@
old_tag = tag + 7; /* C + xxxxxx */
/* |"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;\">");
- } else if (purple_str_has_prefix(tag, "GRA")) {
+ } else if (g_str_has_prefix(tag, "GRA")) { g_string_append(formatted, "<span style=\"color: gray;\">");
- } else if (purple_str_has_prefix(tag, "NOR")) {
+ } else if (g_str_has_prefix(tag, "NOR")) { g_string_append(formatted, "<span style=\"color: black;\">");
- } else if (purple_str_has_prefix(tag, "ITA")) {
+ } else if (g_str_has_prefix(tag, "ITA")) { g_string_append(formatted, "<span style=\"color: blue;\">");
- } else if (purple_str_has_prefix(tag, "GRE")) {
+ } else if (g_str_has_prefix(tag, "GRE")) { g_string_append(formatted, "<span style=\"color: darkgreen;\">");
@@ -2429,7 +2434,7 @@
- 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 @@
/* 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);
--- a/pidgin/gtkutils.c Mon Nov 04 02:22:52 2019 -0500
+++ b/pidgin/gtkutils.c Mon Nov 04 02:36:50 2019 -0500
@@ -1374,7 +1374,7 @@
/* Are we trying to send a .desktop file? */
- else if (purple_str_has_suffix(basename, ".desktop")) {
+ else if (g_str_has_suffix(basename, ".desktop")) { pidgin_dnd_file_send_desktop(account, who, filename);
@@ -1579,8 +1579,7 @@
gtk_tree_model_get_value(model, iter, COMPLETION_NORMALIZED_COLUMN, &val1);
tmp = g_value_get_string(&val1);
- if (tmp != NULL && purple_str_has_prefix(tmp, key))
+ if (tmp != NULL && g_str_has_prefix(tmp, key)) { @@ -1589,8 +1588,7 @@
gtk_tree_model_get_value(model, iter, COMPLETION_COMPARISON_COLUMN, &val2);
tmp = g_value_get_string(&val2);
- if (tmp != NULL && purple_str_has_prefix(tmp, key))
+ if (tmp != NULL && g_str_has_prefix(tmp, key)) { @@ -2351,15 +2349,13 @@
normalized = g_utf8_casefold(tmp, -1);
- if (purple_str_has_prefix(normalized, enteredstring))
+ if (g_str_has_prefix(normalized, enteredstring)) {
/* Use Pango to separate by words. */
len = g_utf8_strlen(normalized, -1);
log_attrs = g_new(PangoLogAttr, len + 1);
@@ -2371,8 +2367,7 @@
for (i = 0; i < (len - 1) ; i++)
if (log_attrs[i].is_word_start &&
- purple_str_has_prefix(word, enteredstring))
+ g_str_has_prefix(word, enteredstring)) { @@ -2390,7 +2385,7 @@
if (!g_unichar_isalnum(c))
word = g_utf8_find_next_char(word, NULL);
- if (purple_str_has_prefix(word, enteredstring))
+ if (g_str_has_prefix(word, enteredstring))