| 50 GSList *buddies; |
50 GSList *buddies; |
| 51 GSList *cur; |
51 GSList *cur; |
| 52 |
52 |
| 53 /* If we're not logging, don't show anything. |
53 /* If we're not logging, don't show anything. |
| 54 * Otherwise, we might show a very old log. */ |
54 * Otherwise, we might show a very old log. */ |
| 55 if (!purple_prefs_get_bool("/core/logging/log_ims")) |
55 if (!purple_prefs_get_bool("/purple/logging/log_ims")) |
| 56 return; |
56 return; |
| 57 |
57 |
| 58 /* Find buddies for this conversation. */ |
58 /* Find buddies for this conversation. */ |
| 59 buddies = purple_find_buddies(account, name); |
59 buddies = purple_find_buddies(account, name); |
| 60 |
60 |
| 94 } |
94 } |
| 95 else if (convtype == PURPLE_CONV_TYPE_CHAT) |
95 else if (convtype == PURPLE_CONV_TYPE_CHAT) |
| 96 { |
96 { |
| 97 /* If we're not logging, don't show anything. |
97 /* If we're not logging, don't show anything. |
| 98 * Otherwise, we might show a very old log. */ |
98 * Otherwise, we might show a very old log. */ |
| 99 if (!purple_prefs_get_bool("/core/logging/log_chats")) |
99 if (!purple_prefs_get_bool("/purple/logging/log_chats")) |
| 100 return; |
100 return; |
| 101 |
101 |
| 102 logs = purple_log_get_logs(PURPLE_LOG_CHAT, name, account); |
102 logs = purple_log_get_logs(PURPLE_LOG_CHAT, name, account); |
| 103 } |
103 } |
| 104 |
104 |
| 139 } |
139 } |
| 140 |
140 |
| 141 static void |
141 static void |
| 142 history_prefs_check(PurplePlugin *plugin) |
142 history_prefs_check(PurplePlugin *plugin) |
| 143 { |
143 { |
| 144 if (!purple_prefs_get_bool("/core/logging/log_ims") && |
144 if (!purple_prefs_get_bool("/purple/logging/log_ims") && |
| 145 !purple_prefs_get_bool("/core/logging/log_chats")) |
145 !purple_prefs_get_bool("/purple/logging/log_chats")) |
| 146 { |
146 { |
| 147 purple_notify_warning(plugin, NULL, _("History Plugin Requires Logging"), |
147 purple_notify_warning(plugin, NULL, _("History Plugin Requires Logging"), |
| 148 _("Logging can be enabled from Tools -> Preferences -> Logging.\n\n" |
148 _("Logging can be enabled from Tools -> Preferences -> Logging.\n\n" |
| 149 "Enabling logs for instant messages and/or chats will activate " |
149 "Enabling logs for instant messages and/or chats will activate " |
| 150 "history for the same conversation type(s).")); |
150 "history for the same conversation type(s).")); |
| 162 { |
162 { |
| 163 purple_signal_connect(purple_conversations_get_handle(), |
163 purple_signal_connect(purple_conversations_get_handle(), |
| 164 "conversation-created", |
164 "conversation-created", |
| 165 plugin, PURPLE_CALLBACK(historize), NULL); |
165 plugin, PURPLE_CALLBACK(historize), NULL); |
| 166 |
166 |
| 167 purple_prefs_connect_callback(plugin, "/core/logging/log_ims", |
167 purple_prefs_connect_callback(plugin, "/purple/logging/log_ims", |
| 168 history_prefs_cb, plugin); |
168 history_prefs_cb, plugin); |
| 169 purple_prefs_connect_callback(plugin, "/core/logging/log_chats", |
169 purple_prefs_connect_callback(plugin, "/purple/logging/log_chats", |
| 170 history_prefs_cb, plugin); |
170 history_prefs_cb, plugin); |
| 171 |
171 |
| 172 history_prefs_check(plugin); |
172 history_prefs_check(plugin); |
| 173 |
173 |
| 174 return TRUE; |
174 return TRUE; |