Mercurial > prosody-modules
comparison mod_privilege/README.markdown @ 1994:f263fcf1b0ed
Merge with Goffi
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 21 Dec 2015 12:24:21 +0100 |
| parents | 8dda3d7d616f |
| children | 3ddab718f717 |
comparison
equal
deleted
inserted
replaced
| 1987:6d7699eda594 | 1994:f263fcf1b0ed |
|---|---|
| 15 Details | 15 Details |
| 16 ======= | 16 ======= |
| 17 | 17 |
| 18 You can have all the details by reading the | 18 You can have all the details by reading the |
| 19 [XEP-0356](http://xmpp.org/extensions/xep-0356.html). | 19 [XEP-0356](http://xmpp.org/extensions/xep-0356.html). |
| 20 | |
| 21 If you use it with a component, you need to patch | |
| 22 core/mod\_component.lua to fire a new signal. To do it, copy the | |
| 23 following patch in a, for example, /tmp/component.patch file: | |
| 24 | |
| 25 ``` {.patch} | |
| 26 diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua | |
| 27 --- a/plugins/mod_component.lua | |
| 28 +++ b/plugins/mod_component.lua | |
| 29 @@ -85,6 +85,7 @@ | |
| 30 session.type = "component"; | |
| 31 module:log("info", "External component successfully authenticated"); | |
| 32 session.send(st.stanza("handshake")); | |
| 33 + module:fire_event("component-authenticated", { session = session }); | |
| 34 | |
| 35 return true; | |
| 36 end | |
| 37 ``` | |
| 38 | |
| 39 Then, at the root of prosody, enter: | |
| 40 | |
| 41 `patch -p1 < /tmp/component.patch` | |
| 42 | 20 |
| 43 Usage | 21 Usage |
| 44 ===== | 22 ===== |
| 45 | 23 |
| 46 To use the module, like usual add **"privilege"** to your | 24 To use the module, like usual add **"privilege"** to your |
| 116 ------------------ ------------------------------------------------------------------------------------------------ | 94 ------------------ ------------------------------------------------------------------------------------------------ |
| 117 | 95 |
| 118 Compatibility | 96 Compatibility |
| 119 ============= | 97 ============= |
| 120 | 98 |
| 99 If you use it with Prosody 0.9 and with a component, you need to patch | |
| 100 core/mod\_component.lua to fire a new signal. To do it, copy the | |
| 101 following patch in a, for example, /tmp/component.patch file: | |
| 102 | |
| 103 ``` {.patch} | |
| 104 diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua | |
| 105 --- a/plugins/mod_component.lua | |
| 106 +++ b/plugins/mod_component.lua | |
| 107 @@ -85,6 +85,7 @@ | |
| 108 session.type = "component"; | |
| 109 module:log("info", "External component successfully authenticated"); | |
| 110 session.send(st.stanza("handshake")); | |
| 111 + module:fire_event("component-authenticated", { session = session }); | |
| 112 | |
| 113 return true; | |
| 114 end | |
| 115 ``` | |
| 116 | |
| 117 Then, at the root of prosody, enter: | |
| 118 | |
| 119 `patch -p1 < /tmp/component.patch` | |
| 120 | |
| 121 ----- ---------------------------------------------------- | 121 ----- ---------------------------------------------------- |
| 122 dev Need a patched core/mod\_component.lua (see above) | 122 0.10 Works |
| 123 0.9 Need a patched core/mod\_component.lua (see above) | 123 0.9 Need a patched core/mod\_component.lua (see above) |
| 124 ----- ---------------------------------------------------- | 124 ----- ---------------------------------------------------- |
| 125 | 125 |
| 126 Note | 126 Note |
| 127 ==== | 127 ==== |
