34 |
34 |
35 <a name="yes.or.no.ansvers"></a> |
35 <a name="yes.or.no.ansvers"></a> |
36 ### yes or no ansvers |
36 ### yes or no ansvers |
37 **Values:** 1, 0, enable, disable, true, false, on, off, yes, no |
37 **Values:** 1, 0, enable, disable, true, false, on, off, yes, no |
38 |
38 |
39 <a name="main.yesno"></a> |
39 <a name="mcabber.yesno"></a> |
40 ### main.yesno |
40 ### mcabber.yesno |
41 According to [yes or no ansvers](#yes.or.no.ansvers) returns true or false. |
41 According to [yes or no ansvers](#yes.or.no.ansvers) returns true or false. |
42 If ansver is not recognized, returns nil. |
42 If ansver is not recognized, returns nil. |
43 **Arguments:** anything (string expected) |
43 **Arguments:** anything (string expected) |
44 **Return values:** boolean or nil |
44 **Return values:** boolean or nil |
45 |
45 |
46 <a name="main.version"></a> |
46 <a name="mcabber.version"></a> |
47 ### main.version |
47 ### mcabber.version |
48 Returns information about mcabber version |
48 Returns table with information about mcabber version |
49 **Return values:** table |
49 **Return values:** table |
50 |
50 |
51 <a name="log.message.type"></a> |
51 <a name="log.message.type"></a> |
52 ### log message type |
52 ### log message type |
53 **Values:** normal, log, debug, notutf8 |
53 **Values:** normal, log, debug, notutf8 |
54 |
54 |
55 <a name="roster.type"></a> |
55 <a name="roster.type"></a> |
56 ### roster type |
56 ### roster type |
57 **Values:** user, group, agent, room, special |
57 **Values:** user, group, agent, room, special |
58 |
58 |
59 <a name="main.log"></a> |
59 <a name="mcabber.log"></a> |
60 ### main.log |
60 ### mcabber.log |
61 Prints message to log. |
61 Prints message to log. |
62 Note: most likely you need notutf8 flag enabled. |
62 Note: most likely you need notutf8 flag enabled. |
63 **Arguments:** [log message type](#log.message.type), message, message... |
63 **Arguments:** [log message type](#log.message.type), message, message... |
64 |
64 |
65 <a name="main.option"></a> |
65 <a name="mcabber.option"></a> |
66 ### main.option |
66 ### mcabber.option |
67 Sets or gets value of mcabber option. |
67 Sets or gets value of given config option. |
68 You can specify nil as a value to delete option. |
68 You can specify nil as a value to delete option. |
69 If you omit option name, it returns hash table of all options. |
69 If you omit option name, it returns hash table of all options. |
70 **Arguments:** string (option name, optional), string (value, optional) |
70 **Arguments:** string (option name, optional), string (value, optional) |
71 **Return values:** string (value, optional) |
71 **Return values:** string (value, optional) |
72 |
72 |
73 <a name="main.alias"></a> |
73 <a name="mcabber.alias"></a> |
74 ### main.alias |
74 ### mcabber.alias |
75 Sets or gets alias. |
75 Sets or gets alias. |
76 You can specify nil as a command to delete alias. |
76 You can specify nil as a command to delete alias. |
77 If you omit alias name, it will return hash table of all aliases. |
77 If you omit alias name, it will return hash table of all aliases. |
78 **Arguments:** string (alias name, optional), string (command, optional) |
78 **Arguments:** string (alias name, optional), string (command, optional) |
79 **Return values:** string (command, optional) |
79 **Return values:** string (command, optional) |
80 |
80 |
81 <a name="main.bind"></a> |
81 <a name="mcabber.bind"></a> |
82 ### main.bind |
82 ### mcabber.bind |
83 Sets or gets binding. |
83 Sets or gets binding. |
84 You can specify nil as a command to unbind key. |
84 You can specify nil as a command to unbind key. |
85 If you omit keycode, it will return hash table of all bindings. |
85 If you omit keycode, it will return hash table of all bindings. |
86 **Arguments:** string (keycode, optional), string (command, optional) |
86 **Arguments:** string (keycode, optional), string (command, optional) |
87 **Return values:** string (command, optional) |
87 **Return values:** string (command, optional) |
88 |
88 |
89 <a name="main.fileoption"></a> |
89 <a name="mcabber.fileoption"></a> |
90 ### main.fileoption |
90 ### mcabber.fileoption |
91 Gets option, expanding it as filename. |
91 Gets option, expanding it as filename. |
92 **Arguments:** string (option name) |
92 **Arguments:** string (option name) |
93 **Return values:** string (expanded option value) or nil |
93 **Return values:** string (expanded option value) or nil |
94 |
94 |
95 <a name="main.connection"></a> |
95 <a name="mcabber.connection"></a> |
96 ### main.connection |
96 ### mcabber.connection |
97 Returns lightuserdata of mcabber's loudmouth connection. |
97 Returns lightuserdata of mcabber's loudmouth connection. |
98 This can be very useful with lua-loudmouth, and not much otherwise. |
98 This can be very useful with lua-loudmouth, and not much otherwise. |
99 **Return values:** lightuserdata or nil |
99 **Return values:** lightuserdata or nil |
100 |
100 |
101 <a name="main.print.info"></a> |
101 <a name="mcabber.print.info"></a> |
102 ### main.print_info |
102 ### mcabber.print_info |
103 Prints a system message to buddy's window. |
103 Prints a system message to buddy's window. |
104 **Arguments:** string (jid), string (message) |
104 **Arguments:** string (jid), string (message) |
105 |
105 |
106 <a name="main.beep"></a> |
106 <a name="mcabber.beep"></a> |
107 ### main.beep |
107 ### mcabber.beep |
108 Beeps with system speaker. |
108 Beeps with system speaker. |
109 |
109 |
110 <a name="main.run"></a> |
110 <a name="mcabber.run"></a> |
111 ### main.run |
111 ### mcabber.run |
112 Runs specified mcabber command. |
112 Executes given string as a mcabber command. |
|
113 Note: You should omit '/' in the beginning. |
113 **Arguments:** string |
114 **Arguments:** string |
114 |
115 |
115 <a name="main.status"></a> |
116 <a name="mcabber.status"></a> |
116 ### main.status |
117 ### mcabber.status |
117 Returns your current status. |
118 Returns your current status. |
118 **Return values:** string (status letter), string (status message) |
119 **Return values:** string (status letter), string (status message) |
119 |
120 |
120 <a name="main.roster"></a> |
121 <a name="mcabber.roster"></a> |
121 ### main.roster |
122 ### mcabber.roster |
122 Returns array of jids of buddies in roster. |
123 Returns array of jids of buddies in roster. |
123 **Return values:** table |
124 **Return values:** table |
124 |
125 |
125 <a name="main.current.buddy"></a> |
126 <a name="mcabber.current.buddy"></a> |
126 ### main.current_buddy |
127 ### mcabber.current_buddy |
127 Returns jid of current selected buddy or sets current buddy to buddy with specified jid. |
128 Returns jid of current selected buddy or sets current buddy to buddy with specified jid. |
128 **Arguments:** string (optional) |
129 **Arguments:** string (optional) |
129 **Return values:** string (optional) |
130 **Return values:** string (optional) |
130 |
131 |
131 <a name="main.full.jid"></a> |
132 <a name="mcabber.full.jid"></a> |
132 ### main.full_jid |
133 ### mcabber.full_jid |
133 Returns full jid (with current resource) of specified buddy (or current, if not specified). |
134 Returns full jid (with current resource) of specified buddy (or current, if not specified). |
134 Note, that if there are no resources online, it will return just what it got. |
135 Note, that if there are no resources online, it will return just what it got. |
135 **Arguments:** string (jid, optional) |
136 **Arguments:** string (jid, optional) |
136 **Return values:** string (jid) |
137 **Return values:** string (jid) |
137 |
138 |
138 <a name="resources.table"></a> |
139 <a name="resources.table"></a> |
139 ### resources table |
140 ### resources table |
140 Hash table with resource name as keys and another hash tables as values. |
141 Hash table with resource name as keys and another hash tables as values. |
141 Inner tables contain resource-specific information: priority, status and message. |
142 Inner tables contain resource-specific information: priority, status and message. |
142 |
143 |
143 <a name="main.buddy.info"></a> |
144 <a name="mcabber.buddy.info"></a> |
144 ### main.buddy_info |
145 ### mcabber.buddy_info |
145 Returns a hash table with information on specified buddy. |
146 Returns a hash table with information on specified buddy. |
146 Table contains fields type, name, onserver and resources (which points to [resources table](#resources.table)). |
147 Table contains fields type, name, onserver and resources (which points to [resources table](#resources.table)). |
147 **Arguments:** string (jid) |
148 **Arguments:** string (jid) |
148 **Return values:** table |
149 **Return values:** table |
149 |
150 |
150 <a name="main.add.feature"></a> |
151 <a name="mcabber.add.feature"></a> |
151 ### main.add_feature |
152 ### mcabber.add_feature |
152 Adds xmlns to disco#info features list. |
153 Adds xmlns to disco#info features list. |
153 **Arguments:** string (xmlns) |
154 **Arguments:** string (xmlns) |
154 |
155 |
155 <a name="main.del.feature"></a> |
156 <a name="mcabber.del.feature"></a> |
156 ### main.del_feature |
157 ### mcabber.del_feature |
157 Removes xmlns from disco#info features list. |
158 Removes xmlns from disco#info features list. |
158 **Arguments:** stirng (xmlns) |
159 **Arguments:** stirng (xmlns) |
159 |
160 |
160 <a name="event.context"></a> |
161 <a name="event.context"></a> |
161 ### event context |
162 ### event context |
207 ### command function |
208 ### command function |
208 Function to handle newly registered command. |
209 Function to handle newly registered command. |
209 Argument type passed depends on how command is registered. |
210 Argument type passed depends on how command is registered. |
210 **Arguments:** string (arguments) or [command arguments table](#command.arguments.table) |
211 **Arguments:** string (arguments) or [command arguments table](#command.arguments.table) |
211 |
212 |
212 <a name="main.parse.args"></a> |
213 <a name="mcabber.parse.args"></a> |
213 ### main.parse_args |
214 ### mcabber.parse_args |
214 Function to parse command argument string to [command arguments table](#command.arguments.table). |
215 Function to parse command argument string to [command arguments table](#command.arguments.table). |
215 **Arguments:** string |
216 **Arguments:** string |
216 **Return values:** table |
217 **Return values:** table |
217 |
218 |
218 <a name="main.add.category"></a> |
219 <a name="mcabber.add.category"></a> |
219 ### main.add_category |
220 ### mcabber.add_category |
220 Adds completion category. |
221 Adds completion category. |
221 **Arguments:** table (values are used as words for completion, optional), argument enum value ([completion sorting order](#completion.sorting.order), optional) |
222 **Arguments:** table (values are used as words for completion, optional), argument enum value ([completion sorting order](#completion.sorting.order), optional) |
222 **Return values:** integer (category id, in fact [completion type](#completion.type)) or nil |
223 **Return values:** integer (category id, in fact [completion type](#completion.type)) or nil |
223 |
224 |
224 <a name="main.del.category"></a> |
225 <a name="mcabber.del.category"></a> |
225 ### main.del_category |
226 ### mcabber.del_category |
226 Removes completion category. |
227 Removes completion category. |
227 **Arguments:** integer (category id) |
228 **Arguments:** integer (category id) |
228 |
229 |
229 <a name="main.add.completion"></a> |
230 <a name="mcabber.add.completion"></a> |
230 ### main.add_completion |
231 ### mcabber.add_completion |
231 Adds word to a completion list. |
232 Adds word to a completion list. |
232 **Arguments:** integer (completion group id), string (word) |
233 **Arguments:** integer (completion group id), string (word) |
233 |
234 |
234 <a name="main.del.completion"></a> |
235 <a name="mcabber.del.completion"></a> |
235 ### main.del_completion |
236 ### mcabber.del_completion |
236 Removes word from a completion list. |
237 Removes word from a completion list. |
237 **Arguments:** integer (completion group id), string (word) |
238 **Arguments:** integer (completion group id), string (word) |
238 |
239 |
239 <a name="main.command"></a> |
240 <a name="mcabber.command"></a> |
240 ### main.command |
241 ### mcabber.command |
241 Associates mcabber command name and lua function. |
242 Associates mcabber command name with given lua function. |
242 As a completion you can also specify a string name (see [completion type](#completion.type)) instead of table, for non-builtin, you can just pass integer id. |
243 As a completion you can also specify a string name (see [completion type](#completion.type)) instead of table. |
|
244 For third-party completions you can just pass integer id. |
243 Note, that for now there are no way to unregister completion group, so, resources can be exausted easily. |
245 Note, that for now there are no way to unregister completion group, so, resources can be exausted easily. |
244 Also note, that it ignores keys in a completion table. |
246 Also note, that it ignores keys in a completion table. |
245 **Arguments:** string (command name), [command function](#command.function), boolean (parse args flag, optional), table (completions, optional)/[completion type](#completion.type) (or integer comletion group id, optional) |
247 **Arguments:** string (command name), [command function](#command.function), boolean (parse args flag, optional), table (completions, optional)/[completion type](#completion.type) (or integer comletion group id, optional) |
246 **Return values:** userdata (command object) |
248 **Return values:** userdata (command object) |
247 |
249 |