about summary refs log tree commit diff stats
path: root/src/event/server_events.h
blob: 73c2ec03e90698ade52d84a254b1d1aa443d9670 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * server_events.h
 *
 * Copyright (C) 2012 - 2015 James Booth <boothj5@gmail.com>
 *
 * This file is part of Profanity.
 *
 * Profanity is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Profanity is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Profanity.  If not, see <http://www.gnu.org/licenses/>.
 *
 * In addition, as a special exception, the copyright holders give permission to
 * link the code of portions of this program with the OpenSSL library under
 * certain conditions as described in each individual source file, and
 * distribute linked combinations including the two.
 *
 * You must obey the GNU General Public License in all respects for all of the
 * code used other than OpenSSL. If you modify file(s) with this exception, you
 * may extend this exception to your version of the file(s), but you are not
 * obligated to do so. If you do not wish to do so, delete this exception
 * statement from your version. If you delete this exception statement from all
 * source files in the program, then also delete it here.
 *
 */

#ifndef SERVER_EVENTS_H
#define SERVER_EVENTS_H

#include "xmpp/xmpp.h"

void sv_ev_login_account_success(char *account_name, int secured);
void sv_ev_lost_connection(void);
void sv_ev_failed_login(void);
void sv_ev_room_invite(jabber_invite_t invite_type,
    const char *const invitor, const char *const room,
    const char *const reason, const char *const password);
void sv_ev_room_broadcast(const char *const room_jid, const char *const message);
void sv_ev_room_subject(const char *const room, const char *const nick, const char *const subject);
void sv_ev_room_history(const char *const room_jid, const char *const nick,
    GDateTime *timestamp, const char *const message);
void sv_ev_room_message(const char *const room_jid, const char *const nick,
    const char *const message);
void sv_ev_incoming_message(char *barejid, char *resource, char *message, char *pgp_message, GDateTime *timestamp);
void sv_ev_incoming_private_message(const char *const fulljid, char *message);
void sv_ev_delayed_private_message(const char *const fulljid, char *message, GDateTime *timestamp);
void sv_ev_typing(char *barejid, char *resource);
void sv_ev_paused(char *barejid, char *resource);
void sv_ev_inactive(char *barejid, char *resource);
void sv_ev_activity(char *barejid, char *resource, gboolean send_states);
void sv_ev_gone(const char *const barejid, const char *const resource);
void sv_ev_subscription(const char *from, jabber_subscr_t type);
void sv_ev_message_receipt(char *barejid, char *id);
void sv_ev_contact_offline(char *contact, char *resource, char *status);
void sv_ev_contact_online(char *contact, Resource *resource, GDateTime *last_activity, char *pgpkey);
void sv_ev_leave_room(const char *const room);
void sv_ev_room_destroy(const char *const room);
void sv_ev_room_occupant_offline(const char *const room, const char *const nick,
    const char *const show, const char *const status);
void sv_ev_room_destroyed(const char *const room, const char *const new_jid, const char *const password,
    const char *const reason);
void sv_ev_room_kicked(const char *const room, const char *const actor, const char *const reason);
void sv_ev_room_occupent_kicked(const char *const room, const char *const nick, const char *const actor,
    const char *const reason);
void sv_ev_room_banned(const char *const room, const char *const actor, const char *const reason);
void sv_ev_room_occupent_banned(const char *const room, const char *const nick, const char *const actor,
    const char *const reason);
void sv_ev_outgoing_carbon(char *barejid, char *message);
void sv_ev_incoming_carbon(char *barejid, char *resource, char *message);
void sv_ev_xmpp_stanza(const char *const msg);
void sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean config_required,
    const char *const role, const char *const affiliation, const char *const actor, const char *const reason,
    const char *const jid, const char *const show, const char *const status);
void sv_ev_muc_occupant_online(const char *const room, const char *const nick, const char *const jid,
    const char *const role, const char *const affiliation, const char *const actor, const char *const reason,
    const char *const show_str, const char *const status_str);
void sv_ev_roster_update(const char *const barejid, const char *const name,
    GSList *groups, const char *const subscription, gboolean pending_out);
void sv_ev_roster_received(void);
int sv_ev_certfail(const char *const errormsg, const char *const certname, const char *const certfp,
    const char *const notbefore, const char *const notafter);
void sv_ev_lastactivity_response(const char *const from, const int seconds, const char *const msg);

#endif
class="o">="Comment"># variant of 'to-text' which stops printing after a few elements (and so is robust to cycles)</span> <span class="muRecipe">def</span> to-text-line in:address:list:_elem<span class="muRecipe"> -&gt; </span>result:address:array:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> buf:address:buffer<span class="Special"> &lt;- </span>new-buffer <span class="Constant">80</span> buf<span class="Special"> &lt;- </span>to-buffer in, buf, <span class="Constant">6</span> <span class="Comment"># max elements to display</span> result<span class="Special"> &lt;- </span>buffer-to-array buf ] <span class="muRecipe">def</span> to-buffer in:address:list:_elem, buf:address:buffer<span class="muRecipe"> -&gt; </span>buf:address:buffer [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> <span class="muControl">break-if</span> in buf<span class="Special"> &lt;- </span>append buf, <span class="Constant">48/0</span> <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># append in.value to buf</span> val:_elem<span class="Special"> &lt;- </span>get *in, <span class="Constant">value:offset</span> buf<span class="Special"> &lt;- </span>append buf, val <span class="Comment"># now prepare next</span> next:address:list:_elem<span class="Special"> &lt;- </span>rest in nextn:number<span class="Special"> &lt;- </span>copy next <span class="muControl">return-unless</span> next buf<span class="Special"> &lt;- </span>append buf, <span class="Constant">[ -&gt; ]</span> <span class="Comment"># and recurse</span> remaining:number, optional-ingredient-found?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span> <span class="Delimiter">{</span> <span class="muControl">break-if</span> optional-ingredient-found? <span class="Comment"># unlimited recursion</span> buf<span class="Special"> &lt;- </span>to-buffer next, buf <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> <span class="muControl">break-unless</span> remaining <span class="Comment"># limited recursion</span> remaining<span class="Special"> &lt;- </span>subtract remaining, <span class="Constant">1</span> buf<span class="Special"> &lt;- </span>to-buffer next, buf, remaining <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># past recursion depth; insert ellipses and stop</span> append buf, <span class="Constant">[...]</span> ] </pre> </body> </html> <!-- vim: set foldmethod=manual : -->