examples/README
author Myhailo Danylenko <isbear@ukrpost.net>
Tue, 03 May 2011 16:27:19 +0300
changeset 115 47bed161e3b0
parent 86 9b98ea6c73f6
child 121 75a7d595817c
permissions -rw-r--r--
Add AVV description file
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     2
How to use these scrpits (and how they are organized):
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     3
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     4
Scripts are generally separated into two classes - library
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
(those in lm subdirectory), that deal mainly with lm and xmpp
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     6
stuff, and mcabber, that provide mcabber interface for library
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     7
scripts - mcabber commands, mcabber message handlers, etc.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     8
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     9
Most of mcabber scripts expect to be require'd from
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
mcabberrc.lua, that will provide common hook and help
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
infrastructure. For 'require' to find scripts, you need to
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
properly set package.path, and in mcabberrc.lua there is
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
example of this on the beginning. Some of this functionality
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
is already implemented in C (and implemented better), so,
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
first look at Modules wiki page.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
However, seems like forms interface is better to be left as
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    18
it is implemented now - it will be too complex, when implemented
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
in C, to be really convenient and easy to add other form types.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
So, I have no plans on converting forms and all functionality,
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
that depends on it to binary C modules. This includes remote
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
commands, registration to jabber entities, muc room administration
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
and some more.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
So, first you need to get development version of mcabber, compiled
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
with --modules-enable. Then you need to build this module. For
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
that see README in top-level dir.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    28
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
Then you need to set modules_dir in your mcabberrc to point to
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    30
directory, where your modules will reside. Now you can issue
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    31
'/load lua' command and get module working. It will provide one
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    32
command - '/lua' (and also some lua functions to allow lua to
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    33
manipulate mcabber to some extent), that evaluates specified
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    34
lua expression.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    35
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    36
Lua module allows to automatically run specified lua file at
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    37
module loading. The name of this file is determined from variable
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    38
lua_init_filename. To use these scripts it should point to
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    39
your edited version of mcabberrc.lua. Also there are some other
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    40
variables, that need to be set up for proper scripts functioning,
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    41
you can find these values in lua.rc. Note, though, that some
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    42
scripts are now unused by me and generally are considered only
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    43
as example - eg jobs, marking etc. In mcabberrc.lua you should
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    44
edit (if necessary) pacakage.path on beginning and set of
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    45
require'd scripts in the end. Rigth now I am using transports,
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    46
room_priv, forms, privacy, muc, vcard, oob, register, remote and
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
attention scripts.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    48
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
Amongst these muc, vcard, register and remote depend on forms,
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
and thus have no hope to be implemented in C in near future.
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
86
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    52
Ah, and almost forgot to mention - for some of the scripts you
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    53
need some external lua modules. First, it is lua-lm - lua
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    54
interface to loudmouth. It is written by me, and thus can be
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    55
fond at the same place, where you find a lua mcabber module.
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    56
Others are posix, base64, socket, sha1 and md5. First three were
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    57
until recent time in Debian repository. Latter two are built from
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    58
one source at http://www.inf.puc-rio.br/~roberto/md5/md5-5/md5.html.
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    59
You can find out, which modules require your scripts by looking at
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    60
'require' lines at the beginning (do not forget to look at scripts,
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    61
that are require'd by this script).
9b98ea6c73f6 Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    62
85
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    63
  -- Myhailo Danylenko <isbear@ukrpost.net>
1e5f17c25133 Examples readme
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    64