--- a/mcabber/src/screen.c Mon Feb 12 22:19:02 2007 +0100
+++ b/mcabber/src/screen.c Tue Feb 13 21:48:17 2007 +0100
@@ -568,6 +568,19 @@
g_free(lines);
}
+static winbuf * scr_CreateWindow(const char *winId, int special, int dont_show)
+{
+ if (special) {
+ if (!statusWindow) {
+ statusWindow = scr_new_buddy(NULL, dont_show);
+ statusWindow->hbuf = statushbuf;
+ }
+ return statusWindow;
+ } else {
+ return scr_new_buddy(winId, dont_show);
+ }
+}
+
// scr_ShowWindow()
// Display the chat window with the given identifier.
// "special" must be true if this is a special buffer window.
@@ -578,15 +591,7 @@
win_entry = scr_SearchWindow(winId, special);
if (!win_entry) {
- if (special) {
- if (!statusWindow) {
- statusWindow = scr_new_buddy(NULL, FALSE);
- statusWindow->hbuf = statushbuf;
- }
- win_entry = statusWindow;
- } else {
- win_entry = scr_new_buddy(winId, FALSE);
- }
+ win_entry = scr_CreateWindow(winId, special, FALSE);
}
top_panel(win_entry->panel);
@@ -675,15 +680,7 @@
// If the window entry doesn't exist yet, let's create it.
if (!win_entry) {
- if (special) {
- if (!statusWindow) {
- statusWindow = scr_new_buddy(NULL, dont_show);
- statusWindow->hbuf = statushbuf;
- }
- win_entry = statusWindow;
- } else {
- win_entry = scr_new_buddy(winId, dont_show);
- }
+ win_entry = scr_CreateWindow(winId, special, dont_show);
}
// The message must be displayed -> update top pointer