/[weechat]/weechat/src/gui/gui-common.c
ViewVC logotype

Diff of /weechat/src/gui/gui-common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by flashcode, Sun Nov 13 15:51:01 2005 UTC revision 1.65 by flashcode, Sat Nov 19 22:08:47 2005 UTC
# Line 362  gui_buffer_new (t_gui_window *window, vo Line 362  gui_buffer_new (t_gui_window *window, vo
362          /* init lines */          /* init lines */
363          new_buffer->lines = NULL;          new_buffer->lines = NULL;
364          new_buffer->last_line = NULL;          new_buffer->last_line = NULL;
365            new_buffer->last_read_line = NULL;
366          new_buffer->num_lines = 0;          new_buffer->num_lines = 0;
367          new_buffer->line_complete = 1;          new_buffer->line_complete = 1;
368                    
# Line 857  gui_printf_internal (t_gui_buffer *buffe Line 858  gui_printf_internal (t_gui_buffer *buffe
858          pos = buf2 - 1;          pos = buf2 - 1;
859          while (pos)          while (pos)
860          {          {
861              if (display_time              if ((!buffer->last_line) || (buffer->line_complete))
                 && cfg_look_buffer_timestamp && cfg_look_buffer_timestamp[0]  
                 && ((!buffer->last_line) || (buffer->line_complete)))  
862              {              {
863                  time_seconds = time (NULL);                  if (display_time && cfg_look_buffer_timestamp &&
864                  local_time = localtime (&time_seconds);                      cfg_look_buffer_timestamp[0])
                 strftime (text_time, sizeof (text_time), cfg_look_buffer_timestamp, local_time);  
                   
                 time_first_digit = -1;  
                 time_last_digit = -1;  
                 i = 0;  
                 while (text_time[i])  
865                  {                  {
866                      if (isdigit (text_time[i]))                      time_seconds = time (NULL);
867                        local_time = localtime (&time_seconds);
868                        strftime (text_time, sizeof (text_time), cfg_look_buffer_timestamp, local_time);
869                        
870                        time_first_digit = -1;
871                        time_last_digit = -1;
872                        i = 0;
873                        while (text_time[i])
874                      {                      {
875                          if (time_first_digit == -1)                          if (isdigit (text_time[i]))
876                              time_first_digit = i;                          {
877                          time_last_digit = i;                              if (time_first_digit == -1)
878                      }                                  time_first_digit = i;
879                      i++;                              time_last_digit = i;
880                  }                          }
881                                            i++;
                 text_time_char[1] = '\0';  
                 i = 0;  
                 while (text_time[i])  
                 {  
                     text_time_char[0] = text_time[i];  
                     if (time_first_digit < 0)  
                     {  
                         gui_add_to_line (buffer, MSG_TYPE_TIME,  
                                          GUI_COLOR(COLOR_WIN_CHAT_TIME));  
                         gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);  
882                      }                      }
883                      else                      
884                        text_time_char[1] = '\0';
885                        i = 0;
886                        while (text_time[i])
887                      {                      {
888                          if ((i < time_first_digit) || (i > time_last_digit))                          text_time_char[0] = text_time[i];
889                            if (time_first_digit < 0)
890                          {                          {
891                              gui_add_to_line (buffer, MSG_TYPE_TIME,                              gui_add_to_line (buffer, MSG_TYPE_TIME,
892                                               GUI_COLOR(COLOR_WIN_CHAT_DARK));                                               GUI_COLOR(COLOR_WIN_CHAT_TIME));
893                              gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);                              gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
894                          }                          }
895                          else                          else
896                          {                          {
897                              if (isdigit (text_time[i]))                              if ((i < time_first_digit) || (i > time_last_digit))
898                              {                              {
899                                  gui_add_to_line (buffer, MSG_TYPE_TIME,                                  gui_add_to_line (buffer, MSG_TYPE_TIME,
900                                                   GUI_COLOR(COLOR_WIN_CHAT_TIME));                                                   GUI_COLOR(COLOR_WIN_CHAT_DARK));
901                                  gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);                                  gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
902                              }                              }
903                              else                              else
904                              {                              {
905                                  gui_add_to_line (buffer, MSG_TYPE_TIME,                                  if (isdigit (text_time[i]))
906                                                   GUI_COLOR(COLOR_WIN_CHAT_TIME_SEP));                                  {
907                                  gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);                                      gui_add_to_line (buffer, MSG_TYPE_TIME,
908                                                         GUI_COLOR(COLOR_WIN_CHAT_TIME));
909                                        gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
910                                    }
911                                    else
912                                    {
913                                        gui_add_to_line (buffer, MSG_TYPE_TIME,
914                                                         GUI_COLOR(COLOR_WIN_CHAT_TIME_SEP));
915                                        gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
916                                    }
917                              }                              }
918                          }                          }
919                            i++;
920                      }                      }
921                      i++;                      gui_add_to_line (buffer, MSG_TYPE_TIME, GUI_COLOR(COLOR_WIN_CHAT));
922                  }                  }
                 gui_add_to_line (buffer, MSG_TYPE_TIME, GUI_COLOR(COLOR_WIN_CHAT));  
923                  gui_add_to_line (buffer, MSG_TYPE_TIME, " ");                  gui_add_to_line (buffer, MSG_TYPE_TIME, " ");
924              }              }
925              gui_add_to_line (buffer, type, pos + 1);              gui_add_to_line (buffer, type, pos + 1);
# Line 1611  gui_buffer_print_log (t_gui_buffer *buff Line 1614  gui_buffer_print_log (t_gui_buffer *buff
1614      wee_log_printf ("  dcc. . . . . . . . . : %d\n",   buffer->dcc);      wee_log_printf ("  dcc. . . . . . . . . : %d\n",   buffer->dcc);
1615      wee_log_printf ("  lines. . . . . . . . : 0x%X\n", buffer->lines);      wee_log_printf ("  lines. . . . . . . . : 0x%X\n", buffer->lines);
1616      wee_log_printf ("  last_line. . . . . . : 0x%X\n", buffer->last_line);      wee_log_printf ("  last_line. . . . . . : 0x%X\n", buffer->last_line);
1617        wee_log_printf ("  last_read_line . . . : 0x%X\n", buffer->last_read_line);
1618      wee_log_printf ("  num_lines. . . . . . : %d\n",   buffer->num_lines);      wee_log_printf ("  num_lines. . . . . . : %d\n",   buffer->num_lines);
1619      wee_log_printf ("  line_complete. . . . : %d\n",   buffer->line_complete);      wee_log_printf ("  line_complete. . . . : %d\n",   buffer->line_complete);
1620      wee_log_printf ("  notify_level . . . . : %d\n",   buffer->notify_level);      wee_log_printf ("  notify_level . . . . : %d\n",   buffer->notify_level);

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26