-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadme.html
103 lines (90 loc) · 3.17 KB
/
readme.html
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
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Callback on message Plugin Readme</title>
<style type="text/css">
BODY {
font-size : 100%;
}
BODY, TD, TH {
font-family : tahoma, verdana, arial, helvetica, sans-serif;
font-size : 0.8em;
}
H2 {
font-size : 10pt;
font-weight : bold;
}
A:hover {
text-decoration : none;
}
H1 {
font-family : tahoma, arial, helvetica, sans-serif;
font-size : 1.4em;
font-weight: bold;
border-bottom : 1px #ccc solid;
padding-bottom : 2px;
}
TT {
font-family : courier new;
font-weight : bold;
color : #060;
}
PRE {
font-family : courier new;
font-size : 100%;
}
#datatable TH {
color : #fff;
background-color : #2A448C;
text-align : left;
}
#datatable TD {
background-color : #FAF6EF;
}
#datatable .name {
background-color : #DCE2F5;
}
</style>
</head>
<body>
<h1>
Callback on message Plugin Readme
</h1>
<h2>Overview</h2>
<p>
Plugin intercepts messages and sends async POST request with JSON body to defined url. It's based on callbackOnOffline plugin created by Pavel Goski and Krzysztof Misztal.
Could be used for a bot implementation. Custom API endpoint gets incoming message callback request, analyses data and sends response message back to a user via Chat API plugin.
</p>
<p>
Example JSON body:
<pre>
<code>
{
"token":"21uh9d1h91d",
"from":"[email protected]",
"to":"[email protected]",
"body":"Message body, so what user's typed"
}
</code>
</pre>
</p>
<h2>Installation</h2>
<p>
Copy callbackOnMessage.jar into the plugins directory of your Openfire installation.
The plugin will then be automatically deployed. To upgrade to a new version,
copy the new callbackOnMessage.jar file over the existing file.
</p>
<h2>
Callback properties
</h2>
There are few properties that can be defined to change plugin behaviour:
<ul>
<li><code>plugin.callback_on_message.debug</code> - enable debug logs. If something doesn't work set property to true</li>
<li><code>plugin.callback_on_message.url</code> - url that will be called</li>
<li><code>plugin.callback_on_message.token</code> - token to be send with request</li>
<li><code>plugin.callback_on_message.send_body</code> - boolean value to determine if message's body will be send. True by default.</li>
<li><code>plugin.callback_on_message.user_status</code> - string value to determine recipient user status (Both, Online, Offline). Both by default.</li>
<li><code>plugin.callback_on_message.user_regex</code> - regular expression to filter recipient user name. Not applicable by default. E.g. "^somebot$" to handle messages sent to [email protected].</li>
</ul>
</body>
</html>