aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libempathy-gtk/empathy-chat-window.c24
2 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a8452521..a6522a34e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-10-01 Xavier Claessens <xclaesse@gmail.com>
+ * libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public
+ functions.
+
+2007-10-01 Xavier Claessens <xclaesse@gmail.com>
+
* libempathy-gtk/empathy-accounts-dialog.c:
* libempathy/empathy-utils.c: Add some sanity checks. Fixes bug #463051.
diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c
index 5d5a1eafe..911fc51f3 100644
--- a/libempathy-gtk/empathy-chat-window.c
+++ b/libempathy-gtk/empathy-chat-window.c
@@ -1758,12 +1758,15 @@ empathy_chat_window_get_dialog (EmpathyChatWindow *window)
void
empathy_chat_window_add_chat (EmpathyChatWindow *window,
- EmpathyChat *chat)
+ EmpathyChat *chat)
{
EmpathyChatWindowPriv *priv;
GtkWidget *label;
GtkWidget *child;
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (EMPATHY_IS_CHAT (chat));
+
priv = GET_PRIV (window);
/* Reference the chat object */
@@ -1808,11 +1811,14 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
void
empathy_chat_window_remove_chat (EmpathyChatWindow *window,
- EmpathyChat *chat)
+ EmpathyChat *chat)
{
EmpathyChatWindowPriv *priv;
gint position;
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (EMPATHY_IS_CHAT (chat));
+
priv = GET_PRIV (window);
position = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook),
@@ -1828,8 +1834,8 @@ empathy_chat_window_remove_chat (EmpathyChatWindow *window,
void
empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
- EmpathyChatWindow *new_window,
- EmpathyChat *chat)
+ EmpathyChatWindow *new_window,
+ EmpathyChat *chat)
{
GtkWidget *widget;
@@ -1859,11 +1865,14 @@ empathy_chat_window_move_chat (EmpathyChatWindow *old_window,
void
empathy_chat_window_switch_to_chat (EmpathyChatWindow *window,
- EmpathyChat *chat)
+ EmpathyChat *chat)
{
EmpathyChatWindowPriv *priv;
gint page_num;
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (EMPATHY_IS_CHAT (chat));
+
priv = GET_PRIV (window);
page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook),
@@ -1889,10 +1898,13 @@ empathy_chat_window_has_focus (EmpathyChatWindow *window)
EmpathyChat *
empathy_chat_window_find_chat (McAccount *account,
- const gchar *id)
+ const gchar *id)
{
GList *l;
+ g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
+ g_return_val_if_fail (!G_STR_EMPTY (id), NULL);
+
for (l = chat_windows; l; l = l->next) {
EmpathyChatWindowPriv *priv;
EmpathyChatWindow *window;