Mercurial > ~mikael > mcabber > hg
diff mcabber/src/screen.c @ 187:4ce9ff808baa
[/trunk] Changeset 199 by mikael
* Add the "/buffer" command (/buffer clear, /buffer top, /buffer bottom)
author | mikael |
---|---|
date | Fri, 06 May 2005 09:35:40 +0000 |
parents | e8e447a07641 |
children | 4f3975f1b852 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Thu May 05 20:50:50 2005 +0000 +++ b/mcabber/src/screen.c Fri May 06 09:35:40 2005 +0000 @@ -922,6 +922,58 @@ doupdate(); } +// scr_BufferTop() +// Jump to the head of the current buddy window +void scr_BufferTop(void) +{ + const gchar *jid; + window_entry_t *win_entry; + + // Get win_entry + if (!current_buddy) return; + jid = CURRENT_JID; + if (!jid) return; + win_entry = scr_SearchWindow(jid); + + if (!win_entry) return; + + win_entry->cleared = FALSE; + win_entry->top = g_list_first(win_entry->hbuf); + + // Refresh the window + scr_UpdateWindow(win_entry); + + // Finished :) + update_panels(); + doupdate(); +} + +// scr_BufferBottom() +// Jump to the end of the current buddy window +void scr_BufferBottom(void) +{ + const gchar *jid; + window_entry_t *win_entry; + + // Get win_entry + if (!current_buddy) return; + jid = CURRENT_JID; + if (!jid) return; + win_entry = scr_SearchWindow(jid); + + if (!win_entry) return; + + win_entry->cleared = FALSE; + win_entry->top = NULL; + + // Refresh the window + scr_UpdateWindow(win_entry); + + // Finished :) + update_panels(); + doupdate(); +} + // scr_LogPrint(...) // Display a message in the log window. void scr_LogPrint(const char *fmt, ...)