Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 1518:63dc211a4c1a
New command: /echo (display a message in the log window)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 27 Sep 2008 22:41:29 +0200 |
parents | 9013d23f0a86 |
children | ac5a2c262098 |
comparison
equal
deleted
inserted
replaced
1517:6df03b9b17ba | 1518:63dc211a4c1a |
---|---|
800 { | 800 { |
801 guint n = settings_opt_get_int("time_prefix"); | 801 guint n = settings_opt_get_int("time_prefix"); |
802 return timepreflengths[(n < 3 ? n : 0)]; | 802 return timepreflengths[(n < 3 ? n : 0)]; |
803 } | 803 } |
804 | 804 |
805 // scr_print_logwindow(string) | |
806 // Display the string in the log window. | |
807 // Note: The string must be in the user's locale! | |
808 void scr_print_logwindow(const char *string) | |
809 { | |
810 time_t timestamp; | |
811 char strtimestamp[64]; | |
812 | |
813 timestamp = time(NULL); | |
814 strftime(strtimestamp, 48, "[%H:%M:%S]", localtime(×tamp)); | |
815 if (Curses) { | |
816 wprintw(logWnd, "\n%s %s", strtimestamp, string); | |
817 update_panels(); | |
818 } else { | |
819 printf("%s %s\n", strtimestamp, string); | |
820 } | |
821 } | |
822 | |
805 // scr_LogPrint(...) | 823 // scr_LogPrint(...) |
806 // Display a message in the log window. | 824 // Display a message in the log window and in the status buffer. |
825 // Add the message to the tracelog file if the log flag is set. | |
807 // This function will convert from UTF-8 unless the LPRINT_NOTUTF8 flag is set. | 826 // This function will convert from UTF-8 unless the LPRINT_NOTUTF8 flag is set. |
808 void scr_LogPrint(unsigned int flag, const char *fmt, ...) | 827 void scr_LogPrint(unsigned int flag, const char *fmt, ...) |
809 { | 828 { |
810 time_t timestamp; | 829 time_t timestamp; |
811 char strtimestamp[64]; | 830 char strtimestamp[64]; |