git://git.camperquake.de
/
videosite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a35ad9
)
videosite-weechat: make hooking of signals dependant on successful init
author
Ralf Ertzinger
<ralf@skytale.net>
Tue, 30 Apr 2013 14:04:53 +0000
(16:04 +0200)
committer
Ralf Ertzinger
<ralf@skytale.net>
Tue, 30 Apr 2013 14:04:53 +0000
(16:04 +0200)
videosite-weechat.pl
patch
|
blob
|
history
diff --git
a/videosite-weechat.pl
b/videosite-weechat.pl
index
fdcc5d5
..
62c8870
100644
(file)
--- a/
videosite-weechat.pl
+++ b/
videosite-weechat.pl
@@
-120,19
+120,15
@@
sub videosite_reset {
_debug => sub { 1 },
})) {
weechat::print("", sprintf("videosite API register failed: %s", $libvideosite::error));
_debug => sub { 1 },
})) {
weechat::print("", sprintf("videosite API register failed: %s", $libvideosite::error));
- return;
+ return
0
;
}
unless(libvideosite::init()) {
weechat::print("", sprintf("videosite init failed: %s", $libvideosite::error));
}
unless(libvideosite::init()) {
weechat::print("", sprintf("videosite init failed: %s", $libvideosite::error));
- return;
+ return
0
;
}
}
- weechat::hook_print("", "notify_message", "://", 1, "message_hook", "");
- weechat::hook_print("", "notify_private", "://", 1, "message_hook", "");
- weechat::hook_print("", "notify_highlight", "://", 1, "message_hook", "");
- weechat::hook_print("", "notify_none", "://", 1, "message_hook", "");
- weechat::hook_command( "videosite", "videosite control functions", "", "", "", "videosite_hook", "");
+ return 1;
}
sub videosite_init {
}
sub videosite_init {
@@
-142,7
+138,13
@@
sub videosite_init {
push(@INC, File::Spec->catfile(weechat::info_get("weechat_dir", ""), 'perl'));
load 'libvideosite';
push(@INC, File::Spec->catfile(weechat::info_get("weechat_dir", ""), 'perl'));
load 'libvideosite';
- videosite_reset();
+ if (videosite_reset()) {
+ weechat::hook_print("", "notify_message", "://", 1, "message_hook", "");
+ weechat::hook_print("", "notify_private", "://", 1, "message_hook", "");
+ weechat::hook_print("", "notify_highlight", "://", 1, "message_hook", "");
+ weechat::hook_print("", "notify_none", "://", 1, "message_hook", "");
+ weechat::hook_command( "videosite", "videosite control functions", "", "", "", "videosite_hook", "");
+ }
}
videosite_init();
}
videosite_init();