| 598 } |
598 } |
| 599 |
599 |
| 600 |
600 |
| 601 /* Look for %n, %d, or %t in msg, and replace with the sender's name, date, |
601 /* Look for %n, %d, or %t in msg, and replace with the sender's name, date, |
| 602 or time */ |
602 or time */ |
| 603 char *away_subs(char *msg, char *name) |
603 char *away_subs(const char *msg, const char *name) |
| 604 { |
604 { |
| 605 char *c; |
605 char *c; |
| 606 static char cpy[BUF_LONG]; |
606 static char cpy[BUF_LONG]; |
| 607 int cnt = 0; |
607 int cnt = 0; |
| 608 time_t t = time(0); |
608 time_t t = time(0); |
| 871 strncpy_withhtml(dest, src, destsize); |
871 strncpy_withhtml(dest, src, destsize); |
| 872 |
872 |
| 873 return(dest); |
873 return(dest); |
| 874 } |
874 } |
| 875 |
875 |
| 876 void away_on_login(char *mesg) |
|
| 877 { |
|
| 878 GSList *awy = away_messages; |
|
| 879 struct away_message *a, *message = NULL; |
|
| 880 struct gaim_gtk_buddy_list *gtkblist; |
|
| 881 |
|
| 882 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
|
| 883 |
|
| 884 if (!gtkblist->window) { |
|
| 885 return; |
|
| 886 } |
|
| 887 |
|
| 888 if (mesg == NULL) { |
|
| 889 /* Use default message */ |
|
| 890 do_away_message(NULL, default_away); |
|
| 891 } else { |
|
| 892 /* Use argument */ |
|
| 893 while (awy) { |
|
| 894 a = (struct away_message *)awy->data; |
|
| 895 if (strcmp(a->name, mesg) == 0) { |
|
| 896 message = a; |
|
| 897 break; |
|
| 898 } |
|
| 899 awy = awy->next; |
|
| 900 } |
|
| 901 if (message == NULL) |
|
| 902 message = default_away; |
|
| 903 do_away_message(NULL, message); |
|
| 904 } |
|
| 905 return; |
|
| 906 } |
|
| 907 |
|
| 908 void strip_linefeed(gchar *text) |
876 void strip_linefeed(gchar *text) |
| 909 { |
877 { |
| 910 int i, j; |
878 int i, j; |
| 911 gchar *text2 = g_malloc(strlen(text) + 1); |
879 gchar *text2 = g_malloc(strlen(text) + 1); |
| 912 |
880 |