Skip to content

Commit

Permalink
Fixed awful pango bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Jul 4, 2010
1 parent 6796ad9 commit 5a04e96
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ui_tabs.c
Expand Up @@ -26,14 +26,16 @@ tab_entry_handler(GtkWidget *mlentry, const char *t, gpointer p)
/* Sending message to the interlocutor
* and printing in in tab's buffer */
Chattab *tab = (Chattab *)p;
gchar *str;
gchar *str, *et;
if (*t == 0) return;
et = g_markup_escape_text(t, -1);
xmpp_send_message(tab->jid, t);
str = lua_msg_markup(get_settings_str(USERNAME), t);
str = lua_msg_markup(get_settings_str(USERNAME), et);
if (str == NULL)
str = g_strdup_printf("%s: %s\n", get_settings_str(USERNAME), t);
ui_tab_append_markup(tab, str);
g_free(str);
g_free(et);
mlentry_clear(mlentry);
} /* tab_entry_handler */

Expand Down Expand Up @@ -255,7 +257,7 @@ ui_tab_print_message(const char *jid, const char *msg)
* to the approprate chat tab */
Chattab *tab = NULL;
GSList *elem;
char *str, *shortjid, *slash;
char *str, *shortjid, *slash, *emsg;
Buddy *sb = NULL;
/* We need to obtain the jid itself, w/o resource */
slash = strchr(jid, '/');
Expand All @@ -279,7 +281,8 @@ ui_tab_print_message(const char *jid, const char *msg)
g_free(shortjid);
}
/* actual message printing - two lines of this whole function! */
str = lua_msg_markup((sb) ? sb->name : jid, msg);
emsg = g_markup_escape_text(msg, -1);
str = lua_msg_markup((sb) ? sb->name : jid, emsg);
if (str == NULL)
str = g_strdup_printf("<b>%s</b>: %s\n", (sb) ? sb->name : jid, msg);
ui_tab_append_markup(tab, str);
Expand All @@ -289,6 +292,7 @@ ui_tab_print_message(const char *jid, const char *msg)
if (tab->jid)
tab_notify(tab);
g_free(str);
g_free(emsg);
} /* ui_tab_print_message */

void ui_tab_set_page(gint n)
Expand Down

0 comments on commit 5a04e96

Please sign in to comment.