Permalink
Browse files

Make :loadsubs reload instanced personals too

Right now if your subs get lost because something falls over, you have
to manually sub to instanced personals to get them back. :loadsubs
doesn't work.

(Supposedly that code is for "backwards compatibility", but... it dates
back to kretch. Probably because it's odd that :loadsubs [file] will
also automatically load the default subs. But given that everyone runs
:loadsubs with no argument to mean "oops zephyr fell over reload my subs
please", I'm okay with adding more code to the "backwards compatibility"
path. I doubt anyone actually runs :loadsubs with an argument anyway.)

Also, while I'm here, get rid of that 'foo' variable. (Really? Really?!
foo?!?)
  • Loading branch information...
1 parent c068c03 commit 05adccf169f26130f56cd69a12829a9d80043a75 @davidben davidben committed Jan 10, 2013
Showing with 9 additions and 8 deletions.
  1. +9 −8 functions.c
View
@@ -870,8 +870,7 @@ void owl_function_unsuball(void)
*/
void owl_function_loadsubs(const char *file)
{
- int ret, ret2;
- const char *foo;
+ int ret, ret2, ret3;
char *path;
if (file==NULL) {
@@ -883,21 +882,23 @@ void owl_function_loadsubs(const char *file)
}
/* for backwards compatibility for now */
- ret2=owl_zephyr_loaddefaultsubs();
+ ret2 = owl_zephyr_loaddefaultsubs();
+ ret3 = owl_zephyr_loadbarnowldefaultsubs();
if (!owl_context_is_interactive(owl_global_get_context(&g))) return;
- foo=file?file:"file";
- if (ret==0 && ret2==0) {
+ if (ret == 0 && ret2 == 0 && ret3 == 0) {
if (!file) {
owl_function_makemsg("Subscribed to messages.");
} else {
owl_function_makemsg("Subscribed to messages from %s", file);
}
- } else if (ret==-1) {
- owl_function_error("Could not read %s", foo);
- } else {
+ } else if (ret == -1) {
+ owl_function_error("Could not read %s", file ? file : "file");
+ } else if (ret2 == -1) {
owl_function_error("Error subscribing to messages");
+ } else {
+ owl_function_error("Error subscribing to instanced personals");
}
}

0 comments on commit 05adccf

Please sign in to comment.