killpresence/killpresence.c
author Mikael Berthe <mikael@lilotux.net>
Sat, 13 Oct 2012 17:26:43 +0200
changeset 45 8e4d38e667ef
parent 44 3f94f3522960
child 46 3bb3be085858
permissions -rw-r--r--
[killpresence] Add option -p to /killpresence (to send a presence probe) /killpresence -p fulljid is equivalent to both /killpresence fulljid followed by /probe barejid
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
/*
37
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
     2
 *  Module "killpresence" -- Ignore current presence of an item
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
     3
 *
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
     4
 * /killpresence [-p] fulljid
37
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
     5
 *  Ignore current presence for the provided JID
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
     6
 *  Useful for kicking ghosts from the roster...
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
     7
 *  Shortcuts can be used for the full jid.  Example:
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
     8
 *    /killpresence ./resource
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
     9
 *  Also, resource '*' stands for all resources.
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    10
 *  If the option -p is given, a presence probe will be sent
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    11
 *  to the user after removing the resource(s).
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    12
 *
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
    13
 * /killchatstates fulljid
37
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    14
 *  Reset chat states for the provided JID
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    15
 *
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    16
 * /probe barejid
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    17
 *  Send a presence probe to the provided JID
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    18
 *
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    19
 *
37
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    20
 * Copyright (C) 2010 Mikael Berthe <mikael@lilotux.net>
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    21
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    22
 * This module is free software; you can redistribute it and/or modify
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    23
 * it under the terms of the GNU General Public License as published by
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    24
 * the Free Software Foundation; either version 2 of the License, or (at
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    25
 * your option) any later version.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    26
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    27
 * This program is distributed in the hope that it will be useful, but
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    28
 * WITHOUT ANY WARRANTY; without even the implied warranty of
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    30
 * General Public License for more details.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    31
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    32
 * You should have received a copy of the GNU General Public License
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    33
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 33
diff changeset
    34
 */
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
#include <string.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
#include <mcabber/modules.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
#include <mcabber/commands.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
#include <mcabber/compl.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
#include <mcabber/roster.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
#include <mcabber/screen.h>
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
#include <mcabber/utils.h>
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
    44
#include <mcabber/xmpp.h>
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
static void killpresence_init(void);
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
static void killpresence_uninit(void);
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    49
static void do_probe(char *);
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    50
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
/* Module description */
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
module_info_t info_killpresence = {
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    53
        .branch         = MCABBER_BRANCH,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    54
        .api            = MCABBER_API_VERSION,
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
    55
        .version        = "0.10",
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    56
        .description    = "Ignore an item's current presence(s)\n"
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    57
                          " Provides the following commands:\n"
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    58
                          " /killpresence [-p] $fulljid\n"
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
    59
                          " /killchatstates $fulljid"
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
    60
                          " /probe $barejid",
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    61
        .requires       = NULL,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    62
        .init           = killpresence_init,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    63
        .uninit         = killpresence_uninit,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    64
        .next           = NULL,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    65
};
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    66
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
    67
#ifdef MCABBER_API_HAVE_CMD_ID
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
    68
static gpointer killpresence_cmdid, killchatstates_cmdid, probe_cmdid;
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
    69
#endif
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
    70
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    71
static void do_killpresence(char *args)
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    72
{
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    73
  char *jid_utf8, *res;
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    74
  const char *targetjid = NULL;
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    75
  bool probe = false;
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    76
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    77
  if (!args || !*args) {
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    78
    scr_log_print(LPRINT_NORMAL, "I need a full JID.");
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
    return;
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    80
  }
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    81
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    82
  if (!strncmp(args, "-p ", 3)) {
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    83
    for (args += 3; *args && *args == ' '; args++)
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    84
      ;
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    85
    probe = true;
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    86
  }
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
    87
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    88
  jid_utf8 = to_utf8(args);
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    89
  if (!jid_utf8)
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    90
    return;
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    91
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    92
  res = strchr(jid_utf8, JID_RESOURCE_SEPARATOR);
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
    93
  if (res) {
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    94
    *res++ = '\0';
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    95
    if (!strcmp(jid_utf8, ".")) {
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    96
      if (current_buddy)
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    97
        targetjid = CURRENT_JID;
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    98
    } else {
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
    99
      targetjid = jid_utf8;
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   100
    }
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   101
  }
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   102
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   103
  if (!targetjid) {
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   104
    scr_log_print(LPRINT_NORMAL, "I need a /full/ JID.");
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   105
    g_free(jid_utf8);
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   106
    return;
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   107
  }
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   108
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   109
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   110
  if (!strcmp(res, "*")) {
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   111
    // Kill all resources!
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   112
    GSList *sl_user = roster_find(targetjid, jidsearch, ROSTER_TYPE_USER);
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   113
    if (sl_user) {
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   114
      scr_log_print(LPRINT_NORMAL,
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   115
                    "Killing all resources from <%s> now!", targetjid);
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   116
      buddy_del_all_resources(sl_user->data);
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   117
    } else {
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   118
      scr_log_print(LPRINT_NORMAL, "Cannot find <%s>...", targetjid);
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   119
    }
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   120
  } else {
43
d759a8b8dbbe [killpresence] /killpresence: Allow '.' as a shortcut for cuurent JID
Mikael Berthe <mikael@lilotux.net>
parents: 42
diff changeset
   121
    roster_setstatus(targetjid, res, 0,
41
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   122
                     offline, "Killed by killpresence.",
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   123
                     0L, role_none, affil_none, NULL);
4e2be5f94743 [killpresence] Allow /killpresence bjid/* to kill all contact's resources
Mikael Berthe <mikael@lilotux.net>
parents: 40
diff changeset
   124
  }
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   125
  buddylist_build();
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   126
  scr_draw_roster();
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   127
45
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
   128
  if (probe)
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
   129
    do_probe((char *)targetjid);
8e4d38e667ef [killpresence] Add option -p to /killpresence (to send a presence probe)
Mikael Berthe <mikael@lilotux.net>
parents: 44
diff changeset
   130
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   131
  g_free(jid_utf8);
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   132
}
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   133
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   134
#if defined XEP0022 || defined XEP0085
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   135
static void reset_chat_states(const char *fulljid)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   136
{
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   137
  char *rname, *barejid;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   138
  GSList *sl_buddy;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   139
  struct xep0085 *xep85;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   140
  struct xep0022 *xep22;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   141
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   142
  rname = strchr(fulljid, JID_RESOURCE_SEPARATOR);
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   143
  if (!rname++) {
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   144
    scr_log_print(LPRINT_NORMAL, "I need a /full/ JID.");
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   145
    return;
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   146
  }
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   147
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   148
  barejid = jidtodisp(fulljid);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   149
  sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   150
  g_free(barejid);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   151
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   152
  if (!sl_buddy) {
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   153
    scr_log_print(LPRINT_NORMAL, "Resource not found.");
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   154
    return;
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   155
  }
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   156
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   157
  xep85 = buddy_resource_xep85(sl_buddy->data, rname);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   158
  xep22 = buddy_resource_xep22(sl_buddy->data, rname);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   159
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   160
  // Reset Chat States (0085)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   161
  if (xep85) {
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   162
    if (xep85->support == CHATSTATES_SUPPORT_PROBED)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   163
      xep85->support = CHATSTATES_SUPPORT_UNKNOWN;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   164
    xep85->last_state_rcvd = ROSTER_EVENT_NONE;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   165
  }
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   166
  // Reset Message Events (0022)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   167
  if (xep22) {
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   168
    if (xep22->support == CHATSTATES_SUPPORT_PROBED)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   169
      xep22->support = CHATSTATES_SUPPORT_UNKNOWN;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   170
    xep22->last_state_rcvd = ROSTER_EVENT_NONE;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   171
    g_free(xep22->last_msgid_sent);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   172
    g_free(xep22->last_msgid_rcvd);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   173
    xep22->last_msgid_sent = NULL;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   174
    xep22->last_msgid_rcvd = NULL;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   175
  }
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   176
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   177
  // Finally reset the roster hint for the UI
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   178
  buddy_resource_setevents(sl_buddy->data, rname, ROSTER_EVENT_NONE);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   179
  update_roster = TRUE;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   180
}
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   181
#endif
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   182
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   183
static void do_killchatstates(char *args)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   184
{
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   185
#if defined XEP0022 || defined XEP0085
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   186
  char *jid_utf8;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   187
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   188
  if (!args || !*args) {
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   189
    scr_log_print(LPRINT_NORMAL, "I need a full JID.");
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   190
    return;
42
e4458bccf486 [killpresence] Make /killchatstates more verbose
Mikael Berthe <mikael@lilotux.net>
parents: 41
diff changeset
   191
  }
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   192
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   193
  jid_utf8 = to_utf8(args);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   194
  if (!jid_utf8)
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   195
    return;
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   196
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   197
  reset_chat_states(jid_utf8);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   198
  g_free(jid_utf8);
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   199
#else
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   200
  scr_log_print(LPRINT_NORMAL, "No Chat State support.");
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   201
#endif
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   202
}
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   203
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   204
static void do_probe(char *args)
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   205
{
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   206
  char *jid_utf8;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   207
  LmMessage *m;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   208
  const char *targetjid = NULL;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   209
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   210
  if (!args || !*args) {
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   211
    scr_log_print(LPRINT_NORMAL, "I need a JID.");
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   212
    return;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   213
  }
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   214
  if (strchr(args, JID_RESOURCE_SEPARATOR)) {
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   215
    scr_log_print(LPRINT_NORMAL, "I need a *bare* JID.");
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   216
    // XXX We could just drop the resource...
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   217
    return;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   218
  }
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   219
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   220
  if (!xmpp_is_online())
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   221
    return;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   222
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   223
  jid_utf8 = to_utf8(args);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   224
  if (!jid_utf8)
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   225
    return;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   226
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   227
  if (!strcmp(jid_utf8, ".")) {
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   228
    if (current_buddy)
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   229
      targetjid = CURRENT_JID;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   230
  } else {
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   231
    targetjid = jid_utf8;
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   232
  }
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   233
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   234
  // Create presence message with type "probe"
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   235
  m = lm_message_new(targetjid, LM_MESSAGE_TYPE_PRESENCE);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   236
  lm_message_node_set_attribute(m->node, "type", "probe");
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   237
  lm_connection_send(lconnection, m, NULL);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   238
  lm_message_unref(m);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   239
  scr_log_print(LPRINT_LOGNORM, "Presence probe sent to <%s>.", targetjid);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   240
  g_free(jid_utf8);
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   241
}
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   242
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   243
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   244
/* Initialization */
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   245
static void killpresence_init(void)
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   246
{
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   247
  /* Add command */
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   248
#ifdef MCABBER_API_HAVE_CMD_ID
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   249
  killpresence_cmdid = cmd_add("killpresence", "Ignore presence",
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   250
                               COMPL_JID, 0, do_killpresence, NULL);
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   251
  killchatstates_cmdid = cmd_add("killchatstates", "Reset chatstates",
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   252
                                 COMPL_JID, 0, do_killchatstates, NULL);
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   253
  probe_cmdid = cmd_add("probe", "Send a presence probe",
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   254
                                 COMPL_JID, 0, do_probe, NULL);
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   255
#else
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   256
  cmd_add("killpresence", "Ignore presence", COMPL_JID, 0,
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   257
          do_killpresence, NULL);
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   258
  cmd_add("killchatstates", "Reset chatstates", COMPL_JID, 0,
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   259
          do_killchatstates, NULL);
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   260
  cmd_add("probe", "Send a presence probe", COMPL_JID, 0,
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   261
          do_probe, NULL);
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   262
#endif
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   263
}
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   264
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   265
/* Uninitialization */
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   266
static void killpresence_uninit(void)
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   267
{
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   268
  /* Unregister command */
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   269
#ifdef MCABBER_API_HAVE_CMD_ID
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   270
  cmd_del(killpresence_cmdid);
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   271
  cmd_del(killchatstates_cmdid);
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   272
  cmd_del(probe_cmdid);
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   273
#else
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   274
  cmd_del("killpresence");
33
e9bb68c35bf3 [killpresence] Add command killchatstates
Mikael Berthe <mikael@lilotux.net>
parents: 20
diff changeset
   275
  cmd_del("killchatstates");
44
3f94f3522960 [killpresence] Add a command /probe to send a presence probe
Mikael Berthe <mikael@lilotux.net>
parents: 43
diff changeset
   276
  cmd_del("probe");
40
5cd4b42ada91 Sync with current mcabber API
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   277
#endif
19
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   278
}
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   279
85296f26810e Add module killpresence
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   280
/* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2:  For Vim users... */