net.server: Fix potential nil handler usage

Automated merge with http://waqas.ath.cx:8000/

Stopped using presencemanager in stanza_router

Automated merge with http://waqas.ath.cx:8000/

mod_presence: initial commit

core/eventmanager2 - new event manager

Allow setting LFLAGS with ./configure --lflags=

mod_debug: Set default interface to 127.0.0.1

net.server: Simple logging fix

core.s2smanager: Don't initiate dialback if we don't have a connection yet

net.server: Remove some debug code which slipped through

Makefiles: Add signal.so to install targets

prosody: Add prosody_shutdown() function to initiate a server shutdown, add code to gracefully close connections before stopping

mod_posix: Allow logging and pidfile options to take effect without needing to daemonize. Add the ability to catch SIGTERM.

xmppserver_listener: Add session:close() method to outgoing s2s connections too

net.server: Add server.setquitting() to gracefully quit the socket loop

util.lsignal: Add lsignal library for catching POSIX signals

Makefiles, util.signal: Add lsignal library for catching POSIX signals

componentmanager: Set core_route_stanza after stanza_router is loaded

componentmanager: Use core_route_stanza to reply in the default component

componentmanager: Restore default component when unregistering

componentmanager: Small logging fix

componentmanager: Improve default component stanza handler

mod_component: Deregister component on disconnect

net.adns: Flush buffer after sending DNS request

mod_component: Update for new net_activate_ports

Allow config to specify listening interfaces

Remove more debugging code which was accidentally committed (don't trust hg)

core.s2smanager: Remove some debugging

Merge

Merge

net.adns: Catch errors in DNS response callbacks

prosody: Don't look to use SSL when LuaSec not available (thanks Florob)

Merge

sessionmanager, componentmanager: Fix some wacky indentation (thanks greyback!)

mod_debug: Run on a different port, and use a different listener to mod_console

Automated merge with http://waqas.ath.cx:8000/

Fixed: Send correct error reply for IQs directed at unavailable resources

Fixed: Issue with presence error routing

mod_muc: Fix malformed presence stanzas (thanks elmex)

util.stanza: stanza:reset() method to reset building state

core.s2smanager: Look away... wait for it... now! Hopefully s2s should be back to normal.

net.server: Ensure some logging parameters are strings

componentmanager: Reply with service-unavailable for unconnected components

core.s2smanager: Check for valid host and port before attempting connection

sessionmanager, s2smanager, mod_component: Send reply </stream:stream> when client closes stream

net.httpserver: Don't log that a request has been left open if it is destroyed

util.dataforms: Allow form layouts to specify default values for fields

util.dataforms: Set form type when generating a form

util.dataforms: Support for retriving the field value data from forms

util.dataforms: Fixes for hidden field type

util.dataforms: Fix some field types which didn't render properly

util.dataforms: Add support for <required/> fields

util.dataforms: Fixed to actually work, mostly

core.sessionmanager: Hop out of <status> tag so that MUC doesn't insert into the wrong level

Tagging 0.4.0

Tagging VERSION 0.4.0

mod_bosh: Fix to correctly timeout idle sessions

mod_debug: Some updates

core.componentmanager: Fix global set, causing problems with multiple components. Fixes #82.

mod_debug: New debug module (a simplified mod_console, with raw Lua access to a running Prosody's internals)

Add lock_globals() and unlock_globals() functions (for when you really need to use globals)

Load util.array and util.iterator at startup

Automated merge with ssh://hg@prosody.im/prosody-hg

Move SSL initialisation into the correct spot (thanks albert)

Added: componentmanager: Automatically add component.host.name to the disco items list of host.name

Fixed: Some nil access bugs

Added: MUC: Room invites

Added: util/events.lua: An event handling library

Fixed: mod_saslauth: "anonymous_login" currently makes SASL ANONYMOUS an exclusive mechanism. Corrected advertised mechanisms and error replies.

Fixed: mod_saslauth: Changed anonymous host option from "sasl_anonymous" to "anonymous_login"

Added: Prevent disk writes for anonmous hosts (option: core/anonymous_login = true)

Added: datamanager: Allow a callback to be installed which selectively prevents disk writes

Fixed: s2smanager: Apply nameprep on hostnames passed in stream tag (part of issue #57)

Fixed: sessionmanager: Apply nameprep on hostname passed in stream tag (part of issue #57)

Fixed: modulemanager: IQs with extended elements in the default namespace could cause backtraces (related to issue #74)

Fixed: mod_roster: Prep JIDs being added to roster (part of issue #57)

Fixed: mod_register: Node prepping was not being applied to usernames (part of issue #57)

Fixed: mod_regster: traceback when removing accounts

Fixed: rostermanager: Create new roster item if one doesn't exist on subscription approval (fixes issue #77)

Fixed: stanza_router: Respond with correct stanza error on malformed stanzas

Fixed: net/http.lua: HTTP request callback wasn't being called on some errors

util.array: Add :reverse() method

util.datetime: Allow specifying a time to format

util.array: Expose array.* functions, to be used for unwrapped arrays

util.iterators: New iterators library

util.array: New array library

util.set: Rename private items container, optimise set.difference() and add set.intersection()

core.rostermanager/mod_roster: Support for roster versioning

util.datamanager: Don't delete data when first entry in table is 'false'. My favourite bug so far.

mod_component: Remove some commented code

core.configmanager: Make components use 'component' module by default if none specified

Update example config, categorise modules, add new modules

prosody.cfg.lua.dist: Remove some factual inaccuracies

mod_component: Use net_activate_ports to start port listener based on config

mod_component: Set default listening interface to 127.0.0.1

net.connlisteners: Allow listeners to specify default interface

prosody: Expose net_activate_ports as a global function for use by plugins

prosody: Allow ports to be specified as just numbers

util.set: Fix to make constructor work, and functions defined correctly

util.set: New util library

net.http: Don't throw error on invalid URLs. Fixes #56.

Add initial mod_component for XEP-0114 support. Albert, where are you?

net.xmppclient_listener: Set default namespace to jabber:client

net.xmppserver_listener: Set default namespace to jabber:server

core.xmlhandlers: Filter out default stream namespace from stanzas

core.stanza_router: Allow routing from components

Merge

Merge

Don't reject some valid IQs. Thanks to elmex for spotting.

0.3->0.4

Automated merge with http://waqas.ath.cx:8000/

mod_xmlrpc: Limit usage to admins

mod_legacyauth: Added stream feature: <auth xmlns='http://jabber.org/features/iq-auth'/>

usermanager: Added is_admin(jid)

Added core.objectmanager

util/xmlrpc: Added <nil/> extension to RPC functions (allowing nil parameters and return values)

mod_saslauth: Disable SASL ANONYMOUS unless explicitly enabled with sasl_anonymous = true

net.adns: Set new send in net.server after 'connecting UDP' socket

net.server: Allow replacement of send function on an open socket

util.logger: Small code tidying :)

Support to filter logging by source via pattern matching from config file.

prosody: Load logger after reading the config

Automated merge with http://waqas.ath.cx:8000/

XML-RPC: Set appropriate Content-Type header in HTTP response

MUC: Kick participants for error replies only on a selected list of error conditions

Let global modules add disco features for all hosts

mod_xmlrpc: Handle RPC stanzas sent over XMPP (XEP-0009: Jabber-RPC)

Allow global modules to hook stanza handlers

Added mod_xmlrpc

Added util/xmlrpc.lua - functions for converting between XML-RPC stanzas and Lua objects

core.presencemanager: Convert Windows line endings to UNIX

net.adns: Return _M

net.adns: Load the correct dns lib

net.adns: Add helper module for performing non-blocking DNS lookups

net.dns: Add methods necessary for allowing non-blocking DNS lookups

net.server: Don't call shutdown method on socket if it doesn't have one, eg. for UDP

net.server: Check for potential nil handler on close

mod_bosh: Set Content-Type in response headers

pposix: Standardize error messages

pposix: Small fix for copyright notice

Automated merge with http://luaetta.ath.cx:1234/

Merged with main tip.

Make the code actually build.

Added missing code.

Adding setrlimits() binding.

tests: Add test for iq error replies

core.configmanager: Small fix to check validity of Component definitions

mod_muc: Don't bounce error replies in response to errors

net.server: Fix to make sure we send a string to logging function

core.stanza_router: Don't bounce errors to iq type=result/error

prosody: Log top-level errors

core.s2smanager: Remove some old commented code, break a long line in 2

util.dataforms: Return the form

net.server: Don't retry if client closes socket during SSL handshaking

Adding initial util.pubsub

core.stanza_router: Reply with error to groupchat messages directed at unavailable resources or offline users

core.componentmanager: Refactor a little to make XEP-0114 plugin a little simpler

net.server: Some fixes for SSL/TLS handshake handling

util.dataforms: First commit, incomplete

core.xmlhandlers: Remove redundant check in condition

prosody: Protect main loop. Dare I say crashing finally becomes impossible.

util.timer: More small fixes I forgot to commit

util.timer: Fix crash when loaded but no tasks set, fix skipping some tasks when multiple set, and one removed

util.multitable: Add mt:search(), use nil for wildcard keys

Better handling of found, but unloadable, core libraries (eg. undefined symbols)

core.xmlhandlers: Optimise completed stanza logic

net/xmppclient_listener: Add some logging and handle unestablished sessions error'ing

mod_register: Fixed an error happening during account deletion

MUC: Added copyright notice

MUC: Replaced some duplicate code

MUC: Removed commented and unused code

Added util/timer.lua - a timer API

MUC: Workaround for a Gajim bug (it includes <x xmlns='http://jabber.org/protocol/muc'/> in nick change presences)

MUC: Use util.stanza.clone instead of pre/deserialize for cloning stanzas

util/stanza: Added clone function

MUC: Syntax error in last commit - this is lua :)

MUC: Throw an error if we try talking to ourselves

core.presencemanager: Set 'from' attribute on outgoing unavailable directed presences

Automated merge with http://waqas.ath.cx:8000/

MUC: Bug fixes and workarounds

Automated merge with http://waqas.ath.cx:8000/

MUC: Logging - logger doesn't like nils

Automated merge with http://waqas.ath.cx:8000/

MUC: Added logging

Automated merge with http://waqas.ath.cx:8000/

MUC: Various fixes

MUC: Fixed: Presence for user joining the roomi was sent twice to the user

mod_bosh: Possible fix for invalid key to next crash

net.server: Fix some more potential nil handler accesses

Merge from waqas

Merge waqas with waqas

MUC: Made vCards work by redirecting vCard requests to bare JIDs

MUC: Kick participants sending error messages to other participants

MUC: Private stanzas (private messages, IQs, etc)

MUC: Presence and message stanzas now fully work (status messages, xhtml-im, etc)

Added tests/run_tests.bat for running tests on Windows

Fixed tests/test.lua to work on Windows

Logging format improvement

Logging format improvement

util.pposix: Add getuid/setuid (we don't use them yet)

mod_version: Operating system detection. Disable with hide_os_type = true in config

Add -Wall to default CFLAGS

Adding TODO notice on UUIDs for usage with SASL ANONYMOUS.

Merging with tip.

Adding inital support for ANONYMOUS mechanism in SASL.

Use $CC, $LD in Makefile. Add --c-compiler, --linker flags to ./configure script. Add --lflags to ./configure script. Thanks to Lorenzo for the initial patch!

Add tests for util.multitable

util.pposix: Fix incompatible pointer type compiler warnings

Add RunScript command to config to run a Lua script prior to starting the server

Add Include command to include extra configuration files from the main one

Report errors in the config file to the user

Fix to correct my email address in AUTHORS file

Fixed: kick_old resource conflict resolution policy could fail with a backtrace

Fixed: User resources not disconnected correctly on account delete

stanza_router: Fix handling of iq from c2s to bare JIDs, thanks to jaharkes for spotting

Add test to check for incorrect handling of iq from c2s to local bare JIDs

Small fix to change verbosity level of subtests

Correct tests for stanza routing IQs to bare JIDs

Merge with waqas for MUC/routing fixes

Change the to attribute of messages to the recipients' bare JID when the recipient/resource is offline.

Stanza router: Message to bare JID fixes

mod_muc: Room history

Fixed: Some presence stanzas from local users were not being routed correctly to components (ghosts in mod_muc)

Fixed directed presence handling to work correctly for components

Changed mod_muc to work with changed component manager

modulemanager initializes hosts[host] if it isn't already initialized when loading a module.

Component-host module loading code was breaking module reload, andduplicated older code. Changed to reuse older code.

util.stanza: Temporary fix for serializing attributes with namespaces

net.server: Fix nil table index assignment

stanza_router: Fix for when clients don't specify priority in initial presence

net.server: Fix potential fatal error in server.lua

mod_bosh: Fix for 'invalid key to next' error when using BOSH

Remove redundant logging and debug printing from mod_bosh

Fix for nil handler error after close

Fix for never checking if the first module for a host is already loaded (affects global modules)

Retagging 0.3.0, used up my mistake quota for today

Update COPYING file... probably the worst thing I could forget to commit in this release :) 0.3.0

Licensing/version updates for some files (forgot to commit, doh...)

Remove redundant linking in util-src modules' Makefile

Happy birthday to me, happy... 0.3.0!

mod_bosh: No need to tostring() uuids now

util.uuid: Return a string, not a number. Looked so innocent.

Update main prosody file, since it doesn't match *.lua pattern, and sed -i treats symlinks badly

Update copyright notices for 2009

0.2->0.3

GPL->MIT!

mod_muc: Add 'nick' to unavailable presence of nick changes. Thanks to Asterix for spotting :)

mod_muc: Convert to unix line endings

Load net.server after util.dependencies to catch missing luasocket

Automated merge with http://waqas.ath.cx:8000/

tools/ejabberd2prosody: Support for pending-in roster items

mod_muc: Add support for being a component

componentmanager: Add support for loading components defined in the config

configmanager: Add support for defining components

hostmanager: Fire event when all hosts are loaded from config

modulemanager: Really fix call_module_method to work properly

modulemanager: Add get_host_type() API method, and fix up call_module_method to work properly

modulemanager: Add module:set_global() as a cleaner way for a module to declare itself 'global'

core.modulemanager: Some refactoring to make upcoming changes a little easier

Friendlier message when config file not found

util.dependencies: Not finding our own libraries is fatal

util.dependencies: Show useful messages when our own libraries are not found, too

server.lua: Comment out unnecessary or very verbose logging, and log the rest as debug level

server.lua: Use Prosody logger for errors, silence non-errors

Port to new server.lua, quite some changes, but I believe everything to be working

net.http: custom_headers -> headers

net.http: Remove request from conn->request table when conn closed

mod_console: Make global

mod_posix: logging fix

Fix for pposix version detection

modulemanager: Comment out logging of modules hooking stanzas, too noisy

util.datamanager: Small fix for clearer logging of data path

Fixed server.lua to use prosody logger for errors

pposix: Remove debug line

pposix: Add syslog_setmask (use config: minimum_log_level = 'warn' etc.)

mod_posix: Check version of pposix

pposix: Add _NAME and _VERSION

stanza_router: That'll teach me to not commit at this time of night. Or not.

Replacing pretty_print() with top_tag() for logging

Fix invalid loglevels in mod_saslauth

mod_posix/pposix: Fix reporting of incorrect PID on daemonization. Log correct PID, and support writing a pidfile (pidfile = '/path/to/prosody.pid' in config). Added getpid() to pposix and improved function names.

mod_posix: Support for logging to syslog (log = 'syslog' in config)

net.connlisteners: Fix to report errors loading connlisteners

net.http: Don't log content from server

net.http: Fix to send query part of URL to server

Stringprep!

util/jid: string prepping functions added: prepped_split and prep

util/logger: setwriter now returns the old writer on success

stanza_router: Fixed error replies for unhandled stanzas

net.http: Fix for callbacks being triggered multiple times for the same request

modulemanager: Check for syntax errors before reloading a module

mod_console: Added module:reload

mod_muc: Added unload, save and restore callbacks to allow reloading code while preserving state

modulemanager: Added reload support, with callbacks for saving and restoring state

Automated merge with http://waqas.ath.cx:8000/

modulemanager: Fixed error on unloading modules with no handlers

mod_muc: deregister component on unload

datamanager: Change log message from type "warn" to "debug" when loading a file fails

mod_saslauth, mod_tls: minor code cleanup

mod_version: Removed and rearranged some code

componentmanager: Removed unneeded parameter from componentmanager.deregister_component

sasl: Set realm to be the current realm when the client didn't send a realm, or sent an empty one

BOSH: Allow BOSH servers to be configured through config file

mod_actions_http: Show tables as 'list's

Add mod_actions_http for executing actions through HTTP

Add core.actions for managing server 'actions'; and make modulemanager register actions 'load' and 'unload'

core.httpserver: Rename request.responseheaders to the more logical request.headers

mod_httpserver: Add require 'net.httpserver'

modulemanager: Change pairs() to ipairs() to allow ordered module loading

Set session.ip to the IP address of connecting clients

BOSH: Make previous fix a bit more efficient

BOSH: Fix for error when closed session was in inactive_sessions list

Add option to in-band registration to allow only whitelisted IPs to register

Added rate limiting to in-band registration, and added IP [black/white]lists

Add child_with_ns() method to stanza elements, and fix child_with_name() to iterate tags rather than all children

Automated merge with http://waqas.ath.cx:8000/

Removed core/offlinemessage.lua along with documentation and references - we have core/offlinemanager.lua instead

modulemanager: Per-host event hooks for plugins - solves issue 41

sasl: Don't fail for realm=""

Implement session:close() for BOSH, and add checking for attempts to connect to hosts we don't serve

Change default maximum inactivity period to 60s from 30s

Add more tests for util/stanza.lua serialization routines

Add test for previous commit

Restore fix for missing last_add on deserialized stanzas. Thanks to tsing for discovering.

Numerous BOSH improvements... handle client disconnects, either explicit or implicit through inactivity; allow specifying BOSH default parameters through config; fix to prevent prematurely closing request connections in some cases, before they were replied to

Protected call for HTTP request callbacks, to catch errors

Fix to prevent calling HTTP request callback twice with the same data

Default mod_console to listening on localhost only. May be changed with console_interface=xxx.xxx.xxx.xxx in the config

Automated merge with http://waqas.ath.cx:8000/

modulemanager: module.unload now gets called when modules are being unloaded

componentmanager: Added support for component deregistering

Remove warning of already-loaded modules at startup

mod_muc: Room subject should be sent only the newly joined occupant

Modulemanager: Basic modules can now be unloaded correctly

mod_console: replace all \n with \r\n in the output, and send \0 as a marker character after every response

mod_muc: Room subjects stored, and room persistence code in place. First user now the owner.

Send host, and not the recipient's JID to module manager (fixes #53)

Initial mod_muc: XEP-0045: Multi-User Chat

Add allow_registration option to disable account registration

Don't use TLS connection handler when SSL/TLS not available or configured (thanks to Ricardo for finding)

Makefile fix for clean target

Updating 0.2.0 tag

Small fix for logging in connlisteners (warning != warn) 0.2.0

Remove some old debugging code from mod_bosh

Remove some debugging code that slipped in

Fix specifying ports in config, and SSL support

Remove logging for server.lua

Remove borken tags

Fix incorrect version number as tag (again) (again)

Fix incorrect version number as tag (again) (again)

Added tag 0.2.0, -m, Fix incorrect version number as tag (again) for changeset 90da4c9b34b5

Added tag 0.20, -m, Fix incorrect version number as tag for changeset 90da4c9b34b5

Added tag 0.20, -m, Fix incorrect version number as tag for changeset 90da4c9b34b5

Added util.multitable.set

Delete the offline message store only when offline messages are present

Return an empty set intead of an error when no disco items are available for a host

Added tag 0.2 for changeset 90da4c9b34b5

HTTP requests now have status code as a number instead of a string. Switched parameters on both http.request() and the callback to better match LuaSocket's http module

Destroy session on failed dialback instead of throwing an error

Automated merge with http://waqas.ath.cx:8000/

Moved directory auto-creation to datamanager

More error replies for offline and non-existing users

Directed presence

Changed order of checking for component hosts to check the full and bare JIDs before the hostname (at another place)

Automated merge with http://waqas.ath.cx:8000/

Changed order of checking for component hosts to check the full and bare JIDs before the hostname

Fix for not loading global modules when host-specific modules are specified in config

Initial mod_bosh, works, kind of, but quite incomplete

Add initial mod_httpserver for serving static content

Adding initial net.httpserver (lots of work to do on it)

Fix nil status code for http request callbacks

Merge from waqas

Bounce stanza errors on failed s2s

Fix data loss when closing connection with a large write queue. Thanks albert :)

Second merge from waqas

Merge from waqas

Fixed URL encoding to generate %0x instead of %x

Optimized stanza_mt.__tostring (called when doing tostring(stanza))

Change xmlhandlers to match stream opening tag with ns+tag

Protect loading of connlisteners, to catch errors

Remove old debugging line from sessionmanager

Remove a FIXME from mod_tls

Add support for dialback piggy-backing. Fixes #37. Thanks to CShadowRun for helping me test :)

Make wraptcpclient set timeout to 0, and add it to the list of exported functions from server.lua

Oops, don't call server.loop() because we'll be running inside the server

Pass HTTP request object to callback

HTTP request callbacks now: handler(code, content) (where code may be 0, and content an error message)

Non-blocking HTTP requests (adding net.http)

0.1 -> 0.2

Newline at end of file for sessionmanager

New, faster, stanza serialization

Add commented line to disable logging entirely

Fix blank tracebacks for c2s/s2s connections

Enable dialback for components

Changed mod_roster to use the newer presence manager API

Don't try processing stanzas not of type get or set in module manager

Fixed a variable redeclaration

Make the ejabberd importer work with host-only roster items

Added: Ports now read from the config

stanza_dispatch != dispatch_stanza

Removed the unnecessary idna.to_ascii applied to the DIGEST-MD5 disgest-uri response values, which was causing auth failures with some clients.

Return error when the given realm value does not match the sent realm value. Prevents impersonation of an account on one virtual host, but a user with the same username on another host.

Fixed util.encodings.base64.decode to not truncate results when encountering an '=' before the end of the given input.

Automated merge with http://waqas.ath.cx:8000/

Latin1 support for SASL DIGEST-MD5 (second, and possibly final commit)

Typo in variable name in last commit

stanza_dispatch = core_process_stanza, fixed for xmpp{client,server} listeners, and sessionmanager for the new syntax

Automated merge with http://waqas.ath.cx:8000/

Latin1 support for SASL DIGEST-MD5 (initial commit)

Small logging adjustment for mod_posix

Slightly more secure dialback secret generation

Merge from waqas

Removed unused variables

Combined and merged similar code

Removed pre-multitable code from module manager

Remove some debugging from pposix.c

Add mod_posix, fixes #5

Add posix support library, and adjust makefiles for it

Code tidying for xmpp{client,server}_listeners

Temporary hack for global modules

Remove print()s from sessionmanager and s2smanager

Make it possible to set custom output handler for logger

Remove old commented code from server.lua

Some code cleaning for the main script

Merge from waqas

Changed module manager to use multitable (initial commit)

Fix add_event_hook in module API

Move the setting of data_path to fix #unfiledbug

Log in hostmanager when a vhost is activated/deactivated

Datamanager logs data_path

Move module loading to modulemanager

Merge from waqas/myself

Merge from waqas

Fixed: Stopped tryint to send error replies on unauthed connections

Add hostmanager, and eventmanager

Small fix for multitable

Re-commit TLS fix

Merge

Backed out changeset 099d8a102deb (committed too much)

Don't say we need TLS after we've already started the handshake

Add TLS socket to readlist before handshake starts, fixes major slow-down on TLS connections

Comment out debug logging for now

Remove linger option on sockets, made no difference, and I forgot to remove it earlier

Fix the last couple of places where we send strings from mod_dialback

Remove an incorrect line which I didn't add, and fix the proper way. Corrects the sending of stanzas over unauthed s2sout's. Also fixes mod_dialback to send stanzas and not strings.

Fix for s2s with jabberd2 (we weren't routing db:verify's over s2sout_unauthed)

Disconnect with stream errors on bad XML, or invalid stream namespace

Add a couple more tests for jid.split

Merge from waqas

MultiTable: Remove all empty sub-tables when elements are removed

Merge from waqas

util.multitable - A table with multiple key for each entry

Automated merge with http://waqas.ath.cx/

Changed util.datamanager to use util.serialization

Changed the datastore for vCards from vCard to vcard in mod_vcard and mod_register

Automated merge with http://waqas.ath.cx/

Changed the ejabberd import script to use util.serialization

Added module util.serialization

Abstract xmlhandlers a bit more, also add error callbacks

Don't send stream:features to incoming s2s connections

Fix logger ids for c2s and s2sout

Automated merge with http://waqas.ath.cx/

Change modules to use the new add_feature module API method.

Added function add_feature to modules API (for adding disco features)

Reorder the disco info elements to place always included elements first

Added tag 0.1.0 for changeset c157c1412bda

Fix Makefile to link with Lua again 0.1.0

Fix configure to save LFLAGS, and also set proper defaults for all sensible OSes

Automated merge with http://84.46.7.57:1234

Making makefile work under OS X finally. Yeah OS X's gcc is a little bit strange.

Using new LFLAGS variable.

Added an error log message for this case

Quick fix for an issue that needs more looking into

Automated merge with http://waqas.ath.cx/

Fix for handling latin1 encoded hostnames in SASL

Fix GPL'ing MIT/X licensed code :)

Update HACKERS

Fill blank with URL

Remove stray merge marker

Merge from waqas

config and data directories taken from path, and quoted to allow spaces in path

Converted prosody.cfg.lua.dist to use windows end-of-lines

Fix license (left some boilerplate in)

and the C files too

Insert copyright/license headers

Fix port number in mod_console instructions

lxmppd -> Prosody

Fix macosx ostype target

Fix debian ostype target

Change sed usage back into one sed script for incompetent versions of sed

Use install to strip symbols

'install' libs to util before top-level make install

Potential fixes for building on Mac OSX

No need for the placeholder file in tests/ because the directory is no longer empty

Add test for latin1toutf8 (which passes)

Converting latin encoded responsed to utf-8 when needed.

Automerge with waqas.

Automated merge with h-h.

Remove that idn stuff for realm because it's either an ugly hack that the password_handler isn't ready for or something worse.

Added function latin1toutf8 to sasl.lua, for processing non-utf8 responses

Makefile fix for creating datadir in correct place on install

Installation improvements (auto-creation of data directories)

Don't overwrite config on make install if it already exists

Path fix for auto-creating directories

Merge from waqas

Auto-create data directories on start

Merge with Tobias

idna-to-unicode so password_handler looks for the right domain.

Do idna-to-ascii to the realm we send first in Digest-MD5.

Yet another fix for the makefile :)

Fix missing prosody.cfg.lua.install

Don't write to prosody.cfg.lua from Makefile. Much apologies to poor albert :(

Add -fPIC to util-src/Makefile

Another automatic merge, this gets annoying."

Fixed the ejabberd importer to work with the pipe sign "|" as a separator in erlang lists

Autocommit.

Automated merge.

Automated merge.

Make ejabberd2prosody.lua a little more cross-platform :)

Make ejabberd2prosody.lua eecutable

Automated merge with http://waqas.ath.cx/

ejabberd db dump importer for Prosody

More Makefile improvements (install the certificates, and update the config on install to find them)

Update Makefile to set correct paths on install with Debian package

Add some example certificates and update the config to point to them

Add COPYING, remove LICENSE

Merfe from Tobias

Apply IDNA to ASCII on hostnames.

Forced merge.

Use unsigned int instead of uint because uint is already in use on OS X.

To use free you should include stdlib.h rather than malloc.h according to man page of free() and various C reference websites.

Do idna_to_ascii when building own response.

Fix for loading connlisteners when running without CFG_SOURCEDIR

Also look for binary modules in the parent directory when running tests

Automated merge with http://waqas.ath.cx/

Moved incoming c2s presence handling from stanza_router to presencemanager

Update Makefile to now pass config paths to prosody. Update prosody, modulemanager and connectionlisteners to obey these paths.

Fix for configmanager when config file can't be found

Rename and update config. Update Makefile for this change.

More Makefile improvements

Add a top-level Makefile and ./configure script. Update util-src Makefile for this.

Removing pull_from_master.sh. Use hg fetch instead.

Load prosody instead of main.lia in mod_console

Make prosody executable

Automated merge with http://waqas.ath.cx/

Added a FIXME

Improved the regexp used to parse the client response a bit. Authenticating with non-ascii realm values now works.

Fixed logging in datamanager

main.lua -> prosody

Merge from waqas

Quickfix for dns.lua to not crash on failed connection to name servers

Added option core.data_path

No more reading 1 byte at a time from sockets

Merge from waqas

Completely switched to new hashes library from the old md5 library

Switched from md5 to sha256 for dialback key generation

Stopped using the lbase64 library

Added make.bat for windows

Removed MS specific preprocessor statements from the Makefile

Add module:unload() to mod_console, and allow module:load() to take config param

Merge from waqas

Makefile now works on windows with Microsoft's compiler

Minor changes to C files (to prevent compiler warnings)

Some mod_console updates

is_loaded() and incomplete unload() for modules

Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.

Nice enhancement for logging output

Removing servermanager... it is no longer used

Log reason for connection failure

(Basic) IDNA and SRV fallback support

Fix to make a global configmanager instance

Fix for hashes.c and encodings.c to rename luaopen for util_*

Fix a waqas copy/paste error. It was my fault again apparently.

Merge from waqas

Added options to limit the number of resources and for handling of resource conflicts

Update mod_selftests to use the hosts on http://xmpp.org/interop/servers.shtml

Yes, we don't put these things in here, we put them in here.

Wrapped a core_process_stanza call in an xpcall call

Added mod_ping with support for [XEP-0199: XMPP Ping]

Changed format for XEP-0090 to the legacy format

Added mod_time with support for [XEP-0202: Entity Time] and [XEP-0090: Entity Time] (deprecated)

Merge from waqas

Modules now sending disco replies

Minor bug fix

Added helper method to discomanager

Add rough Makefile for util-src/

Removed commented code

Added util-src/hashes.c - support for sha1, sha256 and md5 hashes

Added util-src/encodings.c - support for base64, stringprep and idna encodings

Update TODO

Refuse to run without SSL/TLS unless run_without_ssl is set in config

Change loading order of modules, config before dependency checking

Some mod_console changes

Trivial whitespace fix in the missing dependency message

Add MD5 to the list of checked dependencies

Friendlier messages on missing dependencies

Fix softreq, so it reports when no suitable MD5 library is found

SSL library is optional, not a fatal error

Some ends too much.

Some changes to report more correct SASL failures. Support for disabled accounts.

Merging with main branch.

Checking some variables for nil so no errors occur that'll break the server.

Removing some debug messages.

Merge from waqas

Added temporary fix for srv on windows: using opendns nameservers

Check to prevent error on IQs from completely unhandled origins

Backed out the backout. Now we're back out.

Reverted my change to modulemanager, to restore those made by waqas

Backed out changeset 79bd7a3e906c

Merge from waqas

Ahem, a bit of an identity crisis..

Removing lxmppd.cfg.dist

Typo prevented modulemanager.load() from returning the error if load failed.

Merge from waqas

Added mod_disco

Added discomanager

Added discohelper

Account deletion support

Check to prevent error for IQs from completely unhandled origins

Removed useless check

Only start console if it is enabled in the config. Note that the exact option is going to change tomorrow.

Add initial mod_console

Comment out remote debug, will later be enabled via config

Small fix for connlisteners to accept nil for userdata

Fix various mistakes in dns.lua

Fix dns for poor Windows users, who have never seen a resolv.conf

Add new lxmppd.cfg.lua.dist example config file

New configmanager. Old-style config files still work, but will print a warning

Fix mod_selftests syntax, and switch it to use config

All the people who don't use TLS, this one's for you.

Add helper function for adding message bodies to stanzas

Now possible to specify nil origin to core_route_stanza. Origin will be chosen as the host of the 'from' attribute on the stanza. Returns false on no such host.

Import initial configmanager, not sure if it works yet, but it does pass the unit tests ;)

Update test.lua with a work-in-progress

Better names for variables

Remove old TODO

Remove some declarations I added while debugging

Improve jid.split() and jid.bare() to pass new test cases with invalid JIDs

Add jid.bare() helper function

Adding selftests module, but not enabling in config

Oops, never added the tests for s2smanager to the repo

Add run_tests.sh

Update unit testing to output coverage reports

Remove or comment useless prints, or change them to log()

Add event for server startup completed: server-started

Don't error reply to stanzas direct over the s2s stream they came from

Use a stanza for c2s stream features instead of an array of strings. Removes a FIXME.

Log number of open sessions on session creation

Remove a debug print() from xmlhandlers

Remove version=1.0 on s2s stream headers, again.

Remove an old FIXME comment

Fix the reversed to/from on the final db:result. Fixes M-Link and Gmail. Thanks dwd!!

Comments and logging fixes

Send version=1.0 again in s2s stream header

Fix for setting the correct host on the socket, seems to fix s2s with XCP

Show which session got disconnected in log message

Don't error if the original s2s connection has closed before we get the dialback result

Don't send version 1.0. Who cares about Gmail?

Send version=1.0 in s2s stream header. Send s2s stream:features when in 1.0 mode.

Don't attempt to auth connection unless stanzas are being sent across it

Log sent s2s stanzas

Incorrect function set as callback

Don't error if streamopened/streamclosed callback is not specified for a session

Extra checks before sending error replies to incoming stanzas

Fix sending of unavailable presence on disconnect

Don't forget to escape XML in attributes. Thanks to the Postgres Q&amp;A room on conference.jabber.org :)

We have SRV resolving \o/

Small fix for servermanager

Fix to prevent send retry when connection is already closed

*ahem* Yes, move along please... though really, quite a classic. :)

session:disconnect() -> session:close() for consistency with other Lua APIs

Remove useless check for unavailable presence (which never exists)

Quite some changes, to:

s2s sessions can now be disconnected, with or without a stream error. Fixes #8

Allow us to close client connections, with or without a stream error. Partially fixes #8, we still need the same for s2s (though it should be almost a straight copy of the code, I'm too tired atm)

Flush write queue before closing socket

Fixed s2s manager's send queue to not store recieved stanza objects (as these can chnage after the send call)

Send unsubscribe and unsubscribed on roster item delete, and broadcast available resources' presence in reply to pre-approved subscription request

Adding logging for outbound presence broadcasts (changed it a bit)

Adding logging for outbound presence broadcasts

Second fix for broadcasting presence of available resources to newly approved contact

Fix for broadcasting presence of available resources to newly approved contact

Moved presence subscription code from stanza_router to presencemanager

Merge with waqas

Fix for putting TLS in stream:features for connections already using TLS. Thanks to albert for spotting.

Fix logging in some cases for client disconnects

Removed unused function send_to_session from sessionmanager (send_to_session replaced by session.send)

Fixed mod_tls to use session.send for sending stanzas

Fixed servermanager to use session.send for sending stanzas

Removed useless [[local send = require "core.sessionmanager".send_to_session]] from mod_uptime and mod_version

Fixed mod_saslauth to use session.send for sending stanzas

Fixed sessionmanager to not send session in place of stream features...

Fixed mod_register to use session.send for sending stanzas

Fixed mod_private to use session.send for sending stanzas

Fixed sessionmanager to use appropriate method for sending stream features

Fixed mod_legacyauth to use session.send for sending stanzas

Fix mod_vcard to use session.send for sending stanzas

Merge with myself (!)

Merge from waqas

Code cleanup for resource binding

Unused variables in mod_tls

You can never have too many tests

Warn when subtest function does not exist

If iq child element has no xmlns, use parent's

Fix mod_roster to use session.send for sending stanzas

Small fix for mod_version

Providing some human readable error messages and some fixes.

Using md5.sum rather than hashes.md5 because we don't want hexadecimal

mod_saslauth: Code cleanup

Made SASL module fit the new interface.

base64 encode the sasl responses

Started using realm in password hashing, and added support for error message replies from sasl

Comment out DIGEST-MD5 until it is fully implemented

Merge new SASL code from Tobias and Waqas

Merging with Waqas' code.

Set username in a SASL object.

Set username on SASL success

Merge with Waqas changes to mod_saslauth.

Made PLAIN method in sasl.lua module follow new interface.

mod_saslauth: Added base64 decoding, encoding check, and cleaned the code up.

Adding some TODO for some security issue.

Merging my new SASL code with Waqas' adjusted saslauth module.

mod_saslauth updated for digest-md5

Rewrote SASL Digest-MD5 responce generating code, fixed some realm related issue and tested it successfully with Psi. Thanks to dwd, remko and jake.

Merging.

Forward response stanzas to sasl.lua and some other stuff.

Fixing some parsing and some other stuff.

Some early attempts on DIGEST-MD5.

Fix logging of disconnect reason, and also sending of unavailable presence on disconnect

Fix routing of outbound iq stanzas

Add tests for core.stanza_router

Add new logger for tests to use

Some fixes for our test runner

Return registered host table when registering a component

Log how many queued stanzas we send

Merge from waqas

Some bugs fixed

Update hostname for identi.ca

Remove some old unused (and empty) functions from s2smanager

Only reply with errors if the stanza is not an error or a result (don't know how much bandwidth this just cost me :) )

Update rostermanager to use new logger

A treat for Linux users ;)

Fix outgoing s2s from components. Fixes #16

Now outgoing s2s sessions are associated with their from_host, fixes #15

Some more logging fixes

Yep, s2s definitely works now. This is just a small fix for logging...

I knew it ;) Fix sending error replies over s2s (though we shouldn't be error'ing on stream:features anyway)

Print out the stanza also

Fix for detecting when we are routing a stanza to ourself (I'm sure this has something to do with you, waqas...)

Another small fix, for logging in s2smanager

Another small fix, for logging in s2smanager

Mmm, s2s fixed :)

Merge from waqas

Added error replies for unhandled stanzas

Added basic offline message support

Added util.datetime: Utility methods to support XEP-0082: XMPP Date and Time Profiles

Added support for storing (and removing), loading and appending to lists of data to datamanager (for supporting offline messages)

Fixed stanza deserialization

Add support for remote debugger

Missed importing a function in last commit

Change sending reply stream header to use top_tag()

Add new top_tag() method to stanzas

Some s2s fixes. Now connect() does not block, and stanzas are not lost when connection is slow

Renamed some of the variables in jid.split test to make it clearer

Fix jid.split test function

Merge from waqas

Fixed typo

Merge from waqas

Added mod_uptime: [XEP-0012: Last Activity] queries now work when directed at the server.

Hack to allow s2s stanzas to work until we do proper namespace handling

Move some code about so that we don't leave connections hanging if they hit the connection timeout

Actually show error and position when we show a traceback :)

Prevent slow connects for s2s from blocking for so long

We don't fail if modules fail to load at startup :)

We now fail if modules fail to load at startup.

Updated usermanager with DIGEST-MD5 support

Fix some very misleading logging

Committing code to get nicer tracebacks for errors, also we no longer consider such errors fatal (probably a bad thing, I know...)

Just committing this warning, because I want to know if the problem really affects us

Add host field to local host sessions

Merge from waqas

Redirecting all stanzas not from origin of type s2sin and c2s to core_handle_stanza

Shortened log output for incoming stanzas and an added check.

Fix for checking components, but we need to look at this whole block to optimise it, really we do

Fixed some whitespace.

Reworked the way lxmppd.cfg is used

Re-applying my changes to componentmanager. Sigh.

Adding component support. Again...

/me glares at waqas for messing up the repo

/me glares at MattJ

Commented a buggy check

Internal component support

Foxed: Copy stanza type in reply for presence and message stanzas

Part 2 of internal components. Should have mentioned that the previous commit was from waqas, this one from me.

Part one of internal component support

Merge (for some reason)

imported patch srv-for-cdr-se.patch

A little whitespace fix

Datamanager now deletes files with no data

Reformatted lxmppd.cfg.dist and removed redundant variable

Removed require "core.stanza_dispatch"

Remove obsolete stanza_dispatch.lua

merge from waqas

Priority based message routing, etc

Added resource priority handling, etc

Fix for previous commit (again)

Fix for previous commit

Fix for add_iq_handler to allow multiple origin types too

vcards for s2s

Fix MD5 loading check

mod_roster fix

Another fix for s2s (well, let's say it was more for modules)

Fix s2s once and for all

General fixes for s2s, to make it more robust (I hope), sending data to remote hosts sane (s2ssession.send() works as expected), recycle outgoing dialback connections, etc.

Fix for mod_version over s2s

mod_version is here

Was a bit hasty to remove send_s2s() from stanza_router. We still use it, and there is no problem with it.

sends2s -> s2s_session.send(), s2s_session.send() -> s2s_session.sends2s()

Added support for XEP-0049: Private XML Storage (mod_private)

mod_vcard: Fixed to use new util.stanza.add_child

Combined some lines

Datamanager Fixes and improvements

Don't set cursor inside added child when using add_child()

Make add_child() behave as expected. Old add_child() is now add_direct_child()

Better logging of s2s connections

Merge presence/subscription support from waqas

Bug fixes and checks for presence subscriptions, etc

Outbound presence subscription

Routing code reorganization

Inbound subscription request

Inbound unsubscribe

Inbound subscription cancellation

Inbound subscription approval

Minor fixes, comments

Little tweak for more useful logging of closed s2s sessions

Log when an incoming dialback verification request is an invalid key for our domain

Remove misleading log message regarding s2s/dialback

Backed out changeset 4adc53e03b4d (garbage collection)

Extra garbage collection, for debugging

other half of previous commit

Clean up session when s2s connections are disconnected

Remove some overly-verbose debug log output

Destroy s2s sendqueue when connection is established successfully and data written

Fix nil concat for good this time (\!)

Fix nil concat when non-existant user is probed (another)

Fix nil concat when non-existant user is probed

Hack until we get SRV resolving

Fix for sessionmanager to not throw error when session doesn't have a private logger

Show error when no MD5 lib available

Fix mod_legacyauth to not use old stanza_dispatch

Merge from waqas

Moved some code and removed unnecessary checks.

Presence fixes (again)

Merging more s2s

Partial s2s commit

s2s works! \o/ \o/ s2s

working incoming s2s \o/ s2s

working outgoing s2s \o/ s2s

dialback keys now verified s2s

No need to comment out s2s in this branch s2s

Backed out changeset 98e9fea75e5b

Backed out changeset 37b3e9ed8918 (again)

Backed out changeset a0fc73d5f48c

Backed out changeset 8f17ba74823c

Reverting stanza_router to non-conflicted version

Making the best attempt out of a bad merge from waqas

Added TODO

Merged from Matthew

Merged from Matthew

Removed .hgtags

Fixed: Works when LuaRocks is not present

Roster updates

Docs update

Presence fixes

Fixed: Some modules did not return anything

Set things up for presence subscriptions.

Initial s2s stuff s2s

Final fix for marking user offline when all resources are gone :)

even faster checking for other sessions... thank you waqas :)

faster checking for other sessions

Fix for not destroying sessions when connection closed.

No s2s yet :)

Added a comment, removed all the old code

TLS/SASL no longer should include the connhandler module

Relocate presence broadcast to core_handle_stanza()

Merge roster & presence from waqas

Fixed: datamanager.store and datamanager.load could crash when username or host arguments were nil. (useful for server specific and global data).

Updated and fixed session documentation

Updated session documentation

Added session property for interested resources

Working presence, presence probes and other fixes

Added: TODO

Fixed: Unhandled stanza handling

Fixed: Roster support

Minor edit, and added a TODO

Added: More complete implementation for mod_roster

Added: Roster manipulation functions to core.rostermanager

Added: presence broadcast

Removed an unnecessary line

Fixed: util/jid.lua now returns module object

Fixed: Typos caused by lack of sleep.

Fixed: mod_roster now outputs all roster data (instead of just the JIDs)

Added some roster management functions

Documented the roster object's structure

Abstract connections with "connection listeners"

server.lua should degrade gracefully when LuaSec not present

Some tiny changes for main.lua

Updated TODO

Remove more of Dolphin's leftovers

Add AUTHORS file

Fix MUC address

Updated pull script for new repo

Fixed: util.stanza.deserialize now handles nil stanzas

Stanza preserialize/deserialize helpers, to strip and restore stanzas respectively. Fixed mod_vcard to use these.

Fixed: incorrect auth check

Minor fix

Merge from Matthew. datamanager.simplesave fix

Added: vCard plugin: mod_vcard

Added: mod_register now replies with an error stanza when file write fails

Added: Datastore support for hosts and global data in addition to users

Fixed routing for IQs to bare JIDs, and added a simple IQ validity check

Fix for saving tables with non-string keys

Merge roster fixes from waqas

Fixed: rostermanager.lua now returns the module

Removed: Unnecessary check in mod_roster. session.roster is guaranteed to be available for "c2s" session type.

Fized: Added check to ensure that resource binding is done after auth.

Load roster on resource bind

Merged docs from paul

Added script to pull from master mercurial repository

Remove debugging output from when doing TLS

Added to a comment

Code cleanup

Added: Local stanza routing

Fixed typo in variable name

forgot to commit mod_tls, oops :)

Beginnings of real stanza routing

Merged local TLS branch

Working TLS! tls

TLS: Handshake works, no data after that tls

Convert spaces->tabs

mod_InBandRegistration -> mod_register

Merged mod_InBandRegistration from waqas

Docs

User registration, etc (jabber:iq:register)

Merge from waqas

Removed unused functions

Fix setting resource before we even know what it is

Merge docs from waqas

Some notes of the stanza and session structures

DEPENDS updated by waqas

Session destruction fixes, some debugging code while we fix the rest. Also change logger to be more useful.

Fix for destruction of unauthed SASL sessions

Added lbase64 to the dependency list

Fix for using wrong auth token as username (fixes Gajim login)

New "import" module to help tidy up all the local declarations at the top of modules

Use xmlns for matching auth tag too

Fix stanza handlers to use xmlns also for matching

Resource binding, XMPP sessions (whatever they're for...)

Small fix for sending stanzas in case of resource binding error

(0) -1000 -960 +960 +1000 +3000 tip

mercurial