equal
deleted
inserted
replaced
560 return; |
560 return; |
561 } |
561 } |
562 |
562 |
563 static void disco_hh (guint32 htype, hk_arg_t *args, gpointer ignore) |
563 static void disco_hh (guint32 htype, hk_arg_t *args, gpointer ignore) |
564 { |
564 { |
|
565 #ifdef HOOK_PRE_DISCONNECT |
|
566 disco_unregister_handlers (); |
|
567 #else |
565 hk_arg_t *arg; |
568 hk_arg_t *arg; |
566 |
569 |
567 for (arg = args; arg->name; ++arg) |
570 for (arg = args; arg->name; ++arg) |
568 if (!strcmp (arg->name, "hook")) { |
571 if (!strcmp (arg->name, "hook")) { |
569 if (!strcmp (arg->value, "hook-pre-disconnect")) |
572 if (!strcmp (arg->value, "hook-pre-disconnect")) |
570 disco_unregister_handlers (); |
573 disco_unregister_handlers (); |
571 return; |
574 return; |
572 } |
575 } |
|
576 #endif |
573 |
577 |
574 return; |
578 return; |
575 } |
579 } |
576 |
580 |
577 const gchar *g_module_check_init(GModule *module) |
581 const gchar *g_module_check_init(GModule *module) |
582 compl_add_category_word (disco_cid, "info"); |
586 compl_add_category_word (disco_cid, "info"); |
583 compl_add_category_word (disco_cid, "items"); |
587 compl_add_category_word (disco_cid, "items"); |
584 } |
588 } |
585 |
589 |
586 // hook handler |
590 // hook handler |
|
591 #ifdef HOOK_PRE_DISCONNECT |
|
592 hk_add_handler (disco_hh, HOOK_PRE_DISCONNECT, NULL); |
|
593 #else |
587 hk_add_handler (disco_hh, HOOK_INTERNAL, NULL); |
594 hk_add_handler (disco_hh, HOOK_INTERNAL, NULL); |
|
595 #endif |
588 |
596 |
589 // command |
597 // command |
590 cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
598 cmd_add ("disco", "", disco_cid, COMPL_JID, do_disco, NULL); |
591 |
599 |
592 return NULL; |
600 return NULL; |