diff --git a/README.md b/README.md index 3e371a3..ab78e28 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,8 @@ executing the provided Makefile, or by using the [User Guide](https://www.dabamos.de/dmpack/guide/#_installation) for complete installation instructions. -Clone the **DMPACK** repository recursively and execute the Makefile with build -target `freebsd`, `linux`, or `linux_aarch64`: +Clone the **DMPACK** repository recursively with Git and execute the Makefile +with build target `freebsd`, `linux`, or `linux_aarch64`: ``` $ git clone --depth 1 --recursive https://github.com/dabamos/dmpack @@ -154,7 +154,19 @@ $ make [freebsd|linux|linux_aarch64] $ make install PREFIX=/opt ``` -On 64-bit Raspberry Pi single-board computers, select target `linux_aarch64`. +If Git is not available, download the archive of the master branch instead and +run the shell script `fetchvendor.sh` to fetch the missing submodules: + +``` +$ curl -L -s -o dmpack-master.zip https://github.com/dabamos/dmpack/archive/refs/heads/master.zip +$ unzip dmpack-master.zip +$ cd dmpack-master/ +$ sh fetchvendor.sh +$ make [freebsd|linux|linux_aarch64] +$ make install PREFIX=/opt +``` + +On 64-bit Raspberry Pi single-board computers running Linux, select target `linux_aarch64`. ## Library diff --git a/app/dmbot.f90 b/app/dmbot.f90 index f317cfb..ae630b8 100644 --- a/app/dmbot.f90 +++ b/app/dmbot.f90 @@ -418,7 +418,7 @@ function message_callback(connection, stanza, user_data) bind(c) type = xmpp_stanza_get_type(stanza) if (type == JABBER_STANZA_TYPE_ERROR) then - call logger%warning('received error stanza', error=E_UNEXPECTED) + call logger%warning('received error message', error=E_UNEXPECTED) return end if @@ -495,7 +495,7 @@ function roster_callback(connection, stanza, user_data) bind(c) call c_f_pointer(user_data, bot) if (xmpp_stanza_get_type(stanza) == JABBER_STANZA_TYPE_ERROR) then - call logger%error('roster query failed', error=E_XMPP) + call logger%error('roster query failed', error=E_UNEXPECTED) return end if diff --git a/guide/guide.adoc b/guide/guide.adoc index 60a91b8..080fd73 100644 --- a/guide/guide.adoc +++ b/guide/guide.adoc @@ -290,8 +290,8 @@ If Git is not available, download the archive of the master branch instead and run the shell script `fetchvendor.sh` to fetch the missing submodules: .... -$ curl -L -s -o dmpack.zip https://github.com/dabamos/dmpack/archive/refs/heads/master.zip -$ unzip dmpack.zip +$ curl -L -s -o dmpack-master.zip https://github.com/dabamos/dmpack/archive/refs/heads/master.zip +$ unzip dmpack-master.zip $ cd dmpack-master/ $ sh fetchvendor.sh .... @@ -825,7 +825,7 @@ for testing. | `--debug` | `-D` | off | Forward log messages of level _debug_ (if logger is set). | `--help` | `-h` | – | Output available command-line arguments and quit. | `--host _host_` | `-H` | – | FQDN of XMPP server (for instance, `example.com`). -| `--jid _string_` | `-J` | – | Bot Jabber ID (for example, `bot@example.com`). +| `--jid _string_` | `-J` | – | Bot Jabber id (for example, `bot@example.com`). | `--logger _name_` | `-l` | – | Optional name of logger. If set, sends logs to <> process of given name. | `--name _name_` | `-n` | `dmbot` | Optional name of instance, XMPP resource, and table in configuration. | `--node _id_` | `-N` | – | Node id. diff --git a/src/dm_jabber.f90 b/src/dm_jabber.f90 index 1bfa2e5..5ef2053 100644 --- a/src/dm_jabber.f90 +++ b/src/dm_jabber.f90 @@ -25,7 +25,6 @@ module dm_jabber !! keep_alive = .true.) !! if (dm_is_ok(rc)) call dm_jabber_run(jabber) !! - !! call dm_jabber_disconnect(jabber) !! call dm_jabber_destroy(jabber) !! call dm_jabber_shutdown() !! ``` @@ -44,21 +43,14 @@ module dm_jabber !! type(xmpp_stream_error_t), intent(in) :: stream_error !! xmpp_stream_error_t * !! type(c_ptr), intent(in), value :: user_data !! void * !! - !! integer :: stat - !! type(c_ptr) :: presence !! type(jabber_type), pointer :: jabber !! !! if (.not. c_associated(user_data)) return !! call c_f_pointer(user_data, jabber) !! !! if (event == XMPP_CONN_CONNECT) then - !! print '("connected")' - !! - !! presence = xmpp_presence_new(jabber%ctx) - !! call xmpp_send(connection, presence) - !! stat = xmpp_stanza_release(presence) + !! call dm_jabber_send_presence(jabber, JABBER_STANZA_TEXT_ONLINE) !! else - !! print '("disconnected")' !! call dm_jabber_stop(jabber) !! end if !! end subroutine connection_callback @@ -75,14 +67,15 @@ module dm_jabber dm_jabber_password_callback => xmpp_password_callback, & dm_jabber_timed_callback => xmpp_timed_handler use :: dm_error + use :: dm_id implicit none (type, external) private - integer, parameter, public :: JABBER_HOST_LEN = 256 !! Max. length of host. - integer, parameter, public :: JABBER_JID_LEN = 64 !! Max. length of Jabber id. - integer, parameter, public :: JABBER_JID_FULL_LEN = 128 !! Max. length of JID with additional resource. - integer, parameter, public :: JABBER_PASSWORD_LEN = 64 !! Max. length of password. - integer, parameter, public :: JABBER_PING_ID_LEN = 32 !! Max. length of ping id. + integer, parameter, public :: JABBER_HOST_LEN = 256 !! Max. length of host. + integer, parameter, public :: JABBER_JID_LEN = 64 !! Max. length of Jabber id. + integer, parameter, public :: JABBER_JID_FULL_LEN = 128 !! Max. length of JID with additional resource. + integer, parameter, public :: JABBER_PASSWORD_LEN = 64 !! Max. length of password. + integer, parameter, public :: JABBER_PING_ID_LEN = ID_LEN !! Max. length of ping id. integer, parameter, public :: JABBER_PORT = 5222 !! Default XMPP port (StartTLS). integer, parameter, public :: JABBER_PORT_TLS = 5223 !! Secondary XMPP port (TLS).