comment/comment.c
changeset 40 5cd4b42ada91
parent 37 a05815df848c
equal deleted inserted replaced
39:aa40c940b180 40:5cd4b42ada91
    35         .init           = comment_init,
    35         .init           = comment_init,
    36         .uninit         = comment_uninit,
    36         .uninit         = comment_uninit,
    37         .next           = NULL,
    37         .next           = NULL,
    38 };
    38 };
    39 
    39 
       
    40 #ifdef MCABBER_API_HAVE_CMD_ID
       
    41 static gpointer comment_cmdid;
       
    42 #endif
       
    43 
    40 static void do_comment(char *args)
    44 static void do_comment(char *args)
    41 {
    45 {
    42   /* This is actually a no-op! */
    46   /* This is actually a no-op! */
    43 }
    47 }
    44 
    48 
    45 /* Initialization */
    49 /* Initialization */
    46 static void comment_init(void)
    50 static void comment_init(void)
    47 {
    51 {
    48   /* Add command */
    52   /* Add command */
       
    53 #ifdef MCABBER_API_HAVE_CMD_ID
       
    54   comment_cmdid = cmd_add("#", "Ignore", 0, 0, do_comment, NULL);
       
    55 #else
    49   cmd_add("#", "Ignore", 0, 0, do_comment, NULL);
    56   cmd_add("#", "Ignore", 0, 0, do_comment, NULL);
       
    57 #endif
    50 }
    58 }
    51 
    59 
    52 /* Deinitialization */
    60 /* Deinitialization */
    53 static void comment_uninit(void)
    61 static void comment_uninit(void)
    54 {
    62 {
    55   /* Unregister command */
    63   /* Unregister command */
       
    64 #ifdef MCABBER_API_HAVE_CMD_ID
       
    65   cmd_del(comment_cmdid);
       
    66 #else
    56   cmd_del("comment");
    67   cmd_del("comment");
       
    68 #endif
    57 }
    69 }
    58 
    70 
    59 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */
    71 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */