comparison src/conversation.c @ 8998:3738d1eac0ad

[gaim-migrate @ 9773] " This patch completes the removal of the Show joins/leaves in chats preferences It also (temporarily?) brings back the UI for the IM/Chat buttons preferences by changing #if 0 to #if 1 so they're still easy to identify to revist later on. The "Individual log file for each buddy's signons" pref became obsolete a while ago and was incorrectly #if'd out with a prefslash04 label. This patch completes it's death. With this patch applied the only prefslash thing that should block release is the custom font/color/size/etc stuff, I think we need to work out what to do there. There's a bit of whitespace cleanup too." --Stu Tomlinson committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 21 May 2004 14:26:31 +0000
parents e2ad3e04d248
children 8f838ae3e710
comparison
equal deleted inserted replaced
8997:8bf2c6122bf1 8998:3738d1eac0ad
1947 insertname_compare)); 1947 insertname_compare));
1948 1948
1949 if (ops != NULL && ops->chat_add_user != NULL) 1949 if (ops != NULL && ops->chat_add_user != NULL)
1950 ops->chat_add_user(conv, user); 1950 ops->chat_add_user(conv, user);
1951 1951
1952 if (gaim_prefs_get_bool("/core/conversations/chat/show_join")) { 1952 if (extra_msg == NULL)
1953 if (extra_msg == NULL) 1953 g_snprintf(tmp, sizeof(tmp), _("%s entered the room."), user);
1954 g_snprintf(tmp, sizeof(tmp), _("%s entered the room."), user); 1954 else
1955 else 1955 g_snprintf(tmp, sizeof(tmp),
1956 g_snprintf(tmp, sizeof(tmp), 1956 _("%s [<I>%s</I>] entered the room."),
1957 _("%s [<I>%s</I>] entered the room."), 1957 user, extra_msg);
1958 user, extra_msg); 1958
1959 1959 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
1960 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
1961 }
1962 1960
1963 gaim_signal_emit(gaim_conversations_get_handle(), 1961 gaim_signal_emit(gaim_conversations_get_handle(),
1964 "chat-buddy-joined", conv, user); 1962 "chat-buddy-joined", conv, user);
1965 } 1963 }
1966 1964
2087 } 2085 }
2088 } 2086 }
2089 2087
2090 /* NOTE: Don't remove them from ignored in case they re-enter. */ 2088 /* NOTE: Don't remove them from ignored in case they re-enter. */
2091 2089
2092 if (gaim_prefs_get_bool("/core/conversations/chat/show_leave")) { 2090 if (reason != NULL && *reason != '\0')
2093 if (reason != NULL && *reason != '\0') 2091 g_snprintf(tmp, sizeof(tmp),
2094 g_snprintf(tmp, sizeof(tmp), 2092 _("%s left the room (%s)."), user, reason);
2095 _("%s left the room (%s)."), user, reason); 2093 else
2096 else 2094 g_snprintf(tmp, sizeof(tmp), _("%s left the room."), user);
2097 g_snprintf(tmp, sizeof(tmp), _("%s left the room."), user); 2095
2098 2096 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
2099 gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL));
2100 }
2101 2097
2102 gaim_signal_emit(gaim_conversations_get_handle(), "chat-buddy-left", 2098 gaim_signal_emit(gaim_conversations_get_handle(), "chat-buddy-left",
2103 conv, user, reason); 2099 conv, user, reason);
2104 } 2100 }
2105 2101
2147 conv, user, reason); 2143 conv, user, reason);
2148 } 2144 }
2149 2145
2150 /* NOTE: Don't remove them from ignored in case they re-enter. */ 2146 /* NOTE: Don't remove them from ignored in case they re-enter. */
2151 2147
2152 if (gaim_prefs_get_bool("/core/conversations/chat/show_leave")) { 2148 if (reason != NULL && *reason != '\0') {
2153 if (reason != NULL && *reason != '\0') { 2149 int i;
2154 int i; 2150 int size = g_list_length(users);
2155 int size = g_list_length(users); 2151 int max = MIN(10, size);
2156 int max = MIN(10, size); 2152 GList *l;
2157 GList *l; 2153
2158 2154 *tmp = '\0';
2159 *tmp = '\0'; 2155
2160 2156 for (l = users, i = 0; i < max; i++, l = l->next) {
2161 for (l = users, i = 0; i < max; i++, l = l->next) { 2157 g_strlcat(tmp, (char *)l->data, sizeof(tmp));
2162 g_strlcat(tmp, (char *)l->data, sizeof(tmp)); 2158
2163 2159 if (i < max - 1)
2164 if (i < max - 1) 2160 g_strlcat(tmp, ", ", sizeof(tmp));
2165 g_strlcat(tmp, ", ", sizeof(tmp));
2166 }
2167
2168 if (size > 10)
2169 g_snprintf(tmp, sizeof(tmp),
2170 _("(+%d more)"), size - 10);
2171
2172 g_snprintf(tmp, sizeof(tmp), _(" left the room (%s)."), reason);
2173
2174 gaim_conversation_write(conv, NULL, tmp,
2175 GAIM_MESSAGE_SYSTEM, time(NULL));
2176 } 2161 }
2162
2163 if (size > 10)
2164 g_snprintf(tmp, sizeof(tmp),
2165 _("(+%d more)"), size - 10);
2166
2167 g_snprintf(tmp, sizeof(tmp), _(" left the room (%s)."), reason);
2168
2169 gaim_conversation_write(conv, NULL, tmp,
2170 GAIM_MESSAGE_SYSTEM, time(NULL));
2177 } 2171 }
2178 } 2172 }
2179 2173
2180 void 2174 void
2181 gaim_conv_chat_clear_users(GaimConvChat *chat) 2175 gaim_conv_chat_clear_users(GaimConvChat *chat)
2642 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE); 2636 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE);
2643 gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE); 2637 gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE);
2644 2638
2645 /* Conversations -> Chat */ 2639 /* Conversations -> Chat */
2646 gaim_prefs_add_none("/core/conversations/chat"); 2640 gaim_prefs_add_none("/core/conversations/chat");
2647 gaim_prefs_add_bool("/core/conversations/chat/show_join", TRUE);
2648 gaim_prefs_add_bool("/core/conversations/chat/show_leave", TRUE);
2649 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE); 2641 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE);
2650 2642
2651 /* Conversations -> IM */ 2643 /* Conversations -> IM */
2652 gaim_prefs_add_none("/core/conversations/im"); 2644 gaim_prefs_add_none("/core/conversations/im");
2653 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE); 2645 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE);