mcabber/mcabber/xmpp.h
author Hermitifier
Wed, 29 Feb 2012 09:18:09 +0100
changeset 2010 a73ce708c2c9
parent 1979 6febc7d1f760
child 2137 0bfc4bfc127c
permissions -rw-r--r--
Fix bookmarks losing autojoin attribute
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1668
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1653
diff changeset
     1
#ifndef __MCABBER_XMPP_H__
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1653
diff changeset
     2
#define __MCABBER_XMPP_H__ 1
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     3
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     4
#include <loudmouth/loudmouth.h>
1668
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1653
diff changeset
     5
#include <mcabber/roster.h>
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     6
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     7
enum iqreq_type {
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     8
  iqreq_none,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
     9
  iqreq_version,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    10
  iqreq_time,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    11
  iqreq_last,
1705
ac881b5f9248 Add /request ping (XEP-0199), by merging isbear's module
Mikael Berthe <mikael@lilotux.net>
parents: 1684
diff changeset
    12
  iqreq_vcard,
ac881b5f9248 Add /request ping (XEP-0199), by merging isbear's module
Mikael Berthe <mikael@lilotux.net>
parents: 1684
diff changeset
    13
  iqreq_ping
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    14
};
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    15
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    16
struct annotation {
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    17
  time_t cdate;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    18
  time_t mdate;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    19
  gchar *jid;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    20
  gchar *text;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    21
};
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    22
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    23
struct bookmark {
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    24
  gchar *roomjid;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    25
  gchar *name;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    26
  gchar *nick;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    27
  guint autojoin;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    28
  /* enum room_printstatus pstatus; */
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    29
  /* enum room_autowhois awhois; */
1979
6febc7d1f760 Add /room setopt flag_joins (Hermitifier)
Mikael Berthe <mikael@lilotux.net>
parents: 1976
diff changeset
    30
  /* enum room_flagjoins fjoins; */
6febc7d1f760 Add /room setopt flag_joins (Hermitifier)
Mikael Berthe <mikael@lilotux.net>
parents: 1976
diff changeset
    31
  /* const char *group; */
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    32
};
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    33
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    34
extern LmConnection* lconnection;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    35
extern LmSSL* lssl;
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    36
1810
8c2651fc217a Improve initial display when there is an error message
Mikael Berthe <mikael@lilotux.net>
parents: 1705
diff changeset
    37
int  xmpp_connect(void);
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    38
void xmpp_disconnect(void);
1684
95df4ea512c8 Provide xmpp_is_online()
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
    39
gboolean xmpp_is_online(void);
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    40
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    41
void xmpp_room_join(const char *room, const char *nickname, const char *passwd);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    42
int xmpp_room_setattrib(const char *roomid, const char *fjid,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    43
                        const char *nick, struct role_affil ra,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    44
                        const char *reason);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    45
void xmpp_room_invite(const char *room, const char *fjid, const char *reason);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    46
void xmpp_room_unlock(const char *room);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    47
void xmpp_room_destroy(const char *room, const char *venue, const char *reason);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    48
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    49
void xmpp_addbuddy(const char *bjid, const char *name, const char *group);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    50
void xmpp_updatebuddy(const char *bjid, const char *name, const char *group);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    51
void xmpp_delbuddy(const char *bjid);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    52
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    53
void xmpp_send_msg(const char *fjid, const char *text, int type,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    54
                   const char *subject, gboolean otrinject, gint *encrypted,
1602
f4a2c6f767d1 Message Receipts support (XEP-0184)
franky
parents: 1599
diff changeset
    55
                   LmMessageSubType type_overwrite, gpointer *xep184);
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    56
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    57
void xmpp_send_s10n(const char *bjid, LmMessageSubType type);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    58
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    59
enum imstatus xmpp_getstatus(void);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    60
const char *xmpp_getstatusmsg(void);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    61
void xmpp_setprevstatus(void);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    62
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    63
void xmpp_setstatus(enum imstatus st, const char *recipient,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    64
                    const char *msg, int do_not_sign);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    65
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    66
void xmpp_send_chatstate(gpointer buddy, guint chatstate);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    67
1920
bfa507815e0c Add caps to presence when joining a MUC room
Mikael Berthe <mikael@lilotux.net>
parents: 1811
diff changeset
    68
void xmpp_insert_entity_capabilities(LmMessageNode *x, enum imstatus status);
bfa507815e0c Add caps to presence when joining a MUC room
Mikael Berthe <mikael@lilotux.net>
parents: 1811
diff changeset
    69
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    70
GSList *xmpp_get_all_storage_bookmarks(void);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    71
GSList *xmpp_get_all_storage_rosternotes(void);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    72
void xmpp_set_storage_bookmark(const char *roomid, const char *name,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    73
                               const char *nick, const char *passwd,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    74
                               int autojoin, enum room_printstatus pstatus,
1979
6febc7d1f760 Add /room setopt flag_joins (Hermitifier)
Mikael Berthe <mikael@lilotux.net>
parents: 1976
diff changeset
    75
                               enum room_autowhois awhois,
6febc7d1f760 Add /room setopt flag_joins (Hermitifier)
Mikael Berthe <mikael@lilotux.net>
parents: 1976
diff changeset
    76
                               enum room_flagjoins fjoins, const char *group);
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    77
struct annotation *xmpp_get_storage_rosternotes(const char *barejid,
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    78
                                                int silent);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    79
void xmpp_set_storage_rosternotes(const char *barejid, const char *note);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    80
guint xmpp_is_bookmarked(const char *bjid);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    81
const char *xmpp_get_bookmark_nick(const char *bjid);
2010
a73ce708c2c9 Fix bookmarks losing autojoin attribute
Hermitifier
parents: 1979
diff changeset
    82
int xmpp_get_bookmark_autojoin(const char *bjid);
1598
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    83
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    84
void xmpp_request(const char *fjid, enum iqreq_type reqtype);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    85
void request_vcard(const char *bjid);
a087125d8fc8 Replace libjabber with loudmouth
franky
parents:
diff changeset
    86
void xmpp_request_storage(const gchar *storage);
1599
dcd5d4c75199 Update/Add headers
Mikael Berthe <mikael@lilotux.net>
parents: 1598
diff changeset
    87
1668
41c26b7d2890 Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1653
diff changeset
    88
#endif /* __MCABBER_XMPP_H__ */
1599
dcd5d4c75199 Update/Add headers
Mikael Berthe <mikael@lilotux.net>
parents: 1598
diff changeset
    89
1811
e6d355e50d7a Update Vim modelines
Mikael Berthe <mikael@lilotux.net>
parents: 1810
diff changeset
    90
/* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2:  For Vim users... */