summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-09-24 19:39:17 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-09-24 19:39:17 +0200
commitace2d20e33da6bd22d08f0cbcf53c85036bece43 (patch)
tree229c2d6e3930866fdffe1b9c430820d33f2b861e /src/core
parent0fd3f8b6eb4e0643f583be150c9c47c479f0ef64 (diff)
downloadweechat-ace2d20e33da6bd22d08f0cbcf53c85036bece43.zip
Fix /upgrade when there is one buffer for all IRC servers
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-upgrade.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index c2c1f1617..3df61740d 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -23,6 +23,7 @@
#include "config.h"
#endif
+#include <stdlib.h>
#include <string.h>
#include "weechat.h"
@@ -278,12 +279,13 @@ int
upgrade_weechat_read_cb (int object_id,
struct t_infolist *infolist)
{
- char *type, *name, *prefix, *group_name;
+ char *type, *name, *prefix, *group_name, option_name[32], *key;
+ char *option_key;
struct t_gui_nick_group *ptr_group;
struct t_gui_buffer *ptr_buffer;
struct timeval creation_time;
void *buf;
- int size;
+ int size, key_index, length;
infolist_reset_item_cursor (infolist);
while (infolist_next (infolist))
@@ -321,6 +323,32 @@ upgrade_weechat_read_cb (int object_id,
infolist_integer (infolist, "nicklist_case_sensitive");
upgrade_current_buffer->nicklist_display_groups =
infolist_integer (infolist, "nicklist_display_groups");
+ gui_buffer_set_highlight_words (upgrade_current_buffer,
+ infolist_string (infolist, "highlight_words"));
+ gui_buffer_set_highlight_tags (upgrade_current_buffer,
+ infolist_string (infolist, "highlight_tags"));
+ key_index = 0;
+ while (1)
+ {
+ snprintf (option_name, sizeof (option_name),
+ "key_%05d", key_index);
+ key = infolist_string (infolist, option_name);
+ if (!key)
+ break;
+ length = 16 + strlen (key) + 1;
+ option_key = malloc (length);
+ if (option_key)
+ {
+ snprintf (option_key, length, "key_bind_%s", key);
+ snprintf (option_name, sizeof (option_name),
+ "key_command_%05d", key_index);
+ gui_buffer_set (upgrade_current_buffer,
+ option_key,
+ infolist_string (infolist, option_name));
+ free (option_key);
+ }
+ key_index++;
+ }
}
}
else