mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 04:26:21 +00:00
@@ -258,22 +258,20 @@ GList*
|
|||||||
wins_get_private_chats(const char* const roomjid)
|
wins_get_private_chats(const char* const roomjid)
|
||||||
{
|
{
|
||||||
GList* result = NULL;
|
GList* result = NULL;
|
||||||
GString* prefix = g_string_new(roomjid);
|
auto_gchar gchar* prefix = g_strdup_printf("%s/", roomjid);
|
||||||
g_string_append(prefix, "/");
|
|
||||||
GList* curr = values;
|
GList* curr = values;
|
||||||
|
|
||||||
while (curr) {
|
while (curr) {
|
||||||
ProfWin* window = curr->data;
|
ProfWin* window = curr->data;
|
||||||
if (window->type == WIN_PRIVATE) {
|
if (window->type == WIN_PRIVATE) {
|
||||||
ProfPrivateWin* privatewin = (ProfPrivateWin*)window;
|
ProfPrivateWin* privatewin = (ProfPrivateWin*)window;
|
||||||
if (roomjid == NULL || g_str_has_prefix(privatewin->fulljid, prefix->str)) {
|
if (roomjid == NULL || g_str_has_prefix(privatewin->fulljid, prefix)) {
|
||||||
result = g_list_append(result, privatewin);
|
result = g_list_append(result, privatewin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_string_free(prefix, TRUE);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,19 +1065,13 @@ wins_create_summary(gboolean unread)
|
|||||||
while (curr) {
|
while (curr) {
|
||||||
ProfWin* window = g_hash_table_lookup(windows, curr->data);
|
ProfWin* window = g_hash_table_lookup(windows, curr->data);
|
||||||
if (!unread || (unread && win_unread(window) > 0)) {
|
if (!unread || (unread && win_unread(window) > 0)) {
|
||||||
GString* line = g_string_new("");
|
|
||||||
|
|
||||||
int ui_index = GPOINTER_TO_INT(curr->data);
|
int ui_index = GPOINTER_TO_INT(curr->data);
|
||||||
auto_gchar gchar* winstring = win_to_string(window);
|
auto_gchar gchar* winstring = win_to_string(window);
|
||||||
if (!winstring) {
|
if (!winstring) {
|
||||||
g_string_free(line, TRUE);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
gchar* line = g_strdup_printf("%d: %s", ui_index, winstring);
|
||||||
g_string_append_printf(line, "%d: %s", ui_index, winstring);
|
result = g_slist_append(result, line);
|
||||||
|
|
||||||
result = g_slist_append(result, strdup(line->str));
|
|
||||||
g_string_free(line, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
@@ -1108,19 +1100,13 @@ wins_create_summary_attention()
|
|||||||
has_attention = mucwin->has_attention;
|
has_attention = mucwin->has_attention;
|
||||||
}
|
}
|
||||||
if (has_attention) {
|
if (has_attention) {
|
||||||
GString* line = g_string_new("");
|
|
||||||
|
|
||||||
int ui_index = GPOINTER_TO_INT(curr->data);
|
int ui_index = GPOINTER_TO_INT(curr->data);
|
||||||
auto_gchar gchar* winstring = win_to_string(window);
|
auto_gchar gchar* winstring = win_to_string(window);
|
||||||
if (!winstring) {
|
if (!winstring) {
|
||||||
g_string_free(line, TRUE);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
gchar* line = g_strdup_printf("%d: %s", ui_index, winstring);
|
||||||
g_string_append_printf(line, "%d: %s", ui_index, winstring);
|
result = g_slist_append(result, line);
|
||||||
|
|
||||||
result = g_slist_append(result, strdup(line->str));
|
|
||||||
g_string_free(line, TRUE);
|
|
||||||
}
|
}
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,11 +275,8 @@ roster_remove(const char* const name, const char* const barejid)
|
|||||||
if (contact) {
|
if (contact) {
|
||||||
GList* resources = p_contact_get_available_resources(contact);
|
GList* resources = p_contact_get_available_resources(contact);
|
||||||
while (resources) {
|
while (resources) {
|
||||||
GString* fulljid = g_string_new(barejid);
|
auto_gchar gchar* fulljid = g_strdup_printf("%s/%s", barejid, resources->data);
|
||||||
g_string_append(fulljid, "/");
|
autocomplete_remove(roster->fulljid_ac, fulljid);
|
||||||
g_string_append(fulljid, resources->data);
|
|
||||||
autocomplete_remove(roster->fulljid_ac, fulljid->str);
|
|
||||||
g_string_free(fulljid, TRUE);
|
|
||||||
resources = g_list_next(resources);
|
resources = g_list_next(resources);
|
||||||
}
|
}
|
||||||
g_list_free(resources);
|
g_list_free(resources);
|
||||||
|
|||||||
Reference in New Issue
Block a user