siplcs.git
4 years agoRelease 1.25.0 -- Buddy Idle Time, RTFfixer1.25.0
Stefan Becker [Sat, 12 Oct 2019 08:48:48 +0000 (12 11:48 +0300)]
Release 1.25.0 -- Buddy Idle Time, RTF

4 years agopurple: add missing "const" to "char *"
Stefan Becker [Fri, 11 Oct 2019 16:22:08 +0000 (11 19:22 +0300)]
purple: add missing "const" to "char *"

Enabling -Wwrite-strings flagged all the places where the const
qualifier was incorrectly left out.

The g_hash_table_insert()'s are also correct, because the hash tables
are using string contants as keys.

4 years agocore: add missing "const" to "char *"
Stefan Becker [Fri, 11 Oct 2019 16:19:48 +0000 (11 19:19 +0300)]
core: add missing "const" to "char *"

Enabling -Wwrite-strings flagged all the places where the const
qualifier was incorrectly left out.

NOTE: the sipe-sign.c implenentation would need a complete rewrite to be
      -Wwrite-strings clean.

4 years agoconfigure: document that -Wwrite-strings is missing
Stefan Becker [Fri, 11 Oct 2019 16:12:26 +0000 (11 19:12 +0300)]
configure: document that -Wwrite-strings is missing

Quote from GCC manual:

   "-Wwrite-strings

    When compiling C, give string constants the type const
    char[length] so that copying the address of one into a non-const
    char * pointer produces a warning. These warnings help you find at
    compile time code that can try to write into a string constant, but
    only if you have been very careful about using const in declarations
    and prototypes. Otherwise, it is just a nuisance.

    This is why we did not make -Wall request these warnings."

While this statement may be true for old code, new code/APIs should
compile with the flag enabled.

At least now this ommission is documented and it is easy for developers
to activate it to check their code.

4 years agoupdate files in preparation for next release
Stefan Becker [Fri, 4 Oct 2019 17:27:14 +0000 (4 20:27 +0300)]
update files in preparation for next release

4 years agoOBS: add BR libnm for Mageia 8+
Stefan Becker [Fri, 4 Oct 2019 18:12:25 +0000 (4 21:12 +0300)]
OBS: add BR libnm for Mageia 8+

It seems that that dependency is missing in libpurple-devel.

4 years agopurple: maintain libpurple < 2.14.0 compatibility
Jakub Adam [Tue, 30 Jul 2019 12:21:36 +0000 (30 14:21 +0200)]
purple: maintain libpurple < 2.14.0 compatibility

4 years agomedia: use purple purple_media_set_require_encryption api
Fabrice Bellet [Sun, 14 Jul 2019 20:55:52 +0000 (14 22:55 +0200)]
media: use purple purple_media_set_require_encryption api

This patch uses the require-encryption property of the farstream
conference element, to block by default the stream at the srtpdec
element at creation time, until we know from sdp whether it will be
encrypted or not. The installation of the keys in the element unblocks
the stream, by processing it through the decoder, else the toggle of the
property to "false" also unblocks the stream in "pass through" mode.

This patch prevents a crypted stream to pass through the srtpdec element
in the short time frame before the crypto elements have been installed,
and to reach the rest of the pipeline, causing codec decoder errors
where decrypted stream is expected.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1016

4 years agopurple: update to latest 3.x.x xfer interfaces
Jakub Adam [Mon, 30 Sep 2019 00:13:34 +0000 (30 02:13 +0200)]
purple: update to latest 3.x.x xfer interfaces

4 years agopurple: rename Iface -> Interface in 3.x.x API
Jakub Adam [Sun, 29 Sep 2019 21:40:27 +0000 (29 23:40 +0200)]
purple: rename Iface -> Interface in 3.x.x API

4 years agopurple: update to latest 3.x.x blist interfaces
Jakub Adam [Sun, 29 Sep 2019 21:35:55 +0000 (29 23:35 +0200)]
purple: update to latest 3.x.x blist interfaces

4 years agoconfigure: update minimum build tool versions
Stefan Becker [Wed, 4 Sep 2019 07:11:29 +0000 (4 10:11 +0300)]
configure: update minimum build tool versions

Minimum versions required for maintainer builds, i.e. to regenerate the
configure script:

- autoconf >= 2.69
- automake >= 1.16
- gettext  >= 0.19.8

Minimum versions required for release builds, i.e. to execute configure:

- intltool >= 0.41.0

4 years agodocumentation: remove HACKING file
Stefan Becker [Wed, 4 Sep 2019 05:50:22 +0000 (4 08:50 +0300)]
documentation: remove HACKING file

The URL given in the text was obsolete. Replace the file with a new
section added to the main README file.

4 years agodocumentation: add build from git instructions
Stefan Becker [Wed, 4 Sep 2019 05:47:33 +0000 (4 08:47 +0300)]
documentation: add build from git instructions

This is not meant to be comprehensive but as a starting point for a
developer.

4 years agodocumentation: update configure rebuild steps
Stefan Becker [Wed, 4 Sep 2019 05:40:42 +0000 (4 08:40 +0300)]
documentation: update configure rebuild steps

Update the instructions to reflect the latest contents of autogen.sh.

4 years agoconfigure: restore GITVERSION generation
Stefan Becker [Tue, 3 Sep 2019 19:16:07 +0000 (3 22:16 +0300)]
configure: restore GITVERSION generation

Too eager delete key...

4 years agoconfigure: simplify autogen.sh
Stefan Becker [Tue, 3 Sep 2019 18:03:34 +0000 (3 21:03 +0300)]
configure: simplify autogen.sh

Instead of executing every tool by hand just use the autoreconf tool
which already executes all tools in the correct order.

4 years agoconfigure: update gettext integration
Stefan Becker [Tue, 3 Sep 2019 17:44:05 +0000 (3 20:44 +0300)]
configure: update gettext integration

- configure.ac: set gettext minimum version to 0.19.8
- autogen.sh:   add autopoint to setup sequence
- .gitignore:   add new maintainer files to ignore
- Makefile.am:  add new maintainer files to delete
- remove dummy ABOUT-NLS/config.rpath files again

4 years agoconfigure: remove AC_PROG_RANLIB
Stefan Becker [Tue, 3 Sep 2019 17:39:21 +0000 (3 20:39 +0300)]
configure: remove AC_PROG_RANLIB

According to autoreconf warning it is obsoleted by LT_INIT.

4 years agoconfigure: remove m4macros directory
Stefan Becker [Tue, 3 Sep 2019 17:05:42 +0000 (3 20:05 +0300)]
configure: remove m4macros directory

As we no longer have any source code in it, we no longer need it in the
build. Change the aclocal options to use/generate the standard "m4"
directory on-the-fly and tell git to ignore it.

4 years agoconfigure: makefile cleanup
Stefan Becker [Thu, 29 Aug 2019 06:43:04 +0000 (29 09:43 +0300)]
configure: makefile cleanup

- Makefile.am: add ylwrap to list of maintainer files
- purple.m4:   this file seems to be obsolete, just remove it

4 years agoconfigure: fix build against latest gettext
Stefan Becker [Thu, 29 Aug 2019 06:40:47 +0000 (29 09:40 +0300)]
configure: fix build against latest gettext

- configure.ac: replace old macros with AM_GNU_GETTEXT
- ABOUT-NLS:    empty file, but it must exist or auto* fails
- config.rpath: empty file, but it must exist or auto* fails

4 years agoFix #358: FTBFS with glib-2.0 >= 2.62.0
Stefan Becker [Wed, 28 Aug 2019 21:03:30 +0000 (29 00:03 +0300)]
Fix #358: FTBFS with glib-2.0 >= 2.62.0

The new glib-2.0 release will introduce new deprecations. The
devel-release is already in Fedora Rawhide and Mageia Cauldron.

4 years agotelepathy: include config.h in more modules
Stefan Becker [Wed, 28 Aug 2019 21:01:19 +0000 (29 00:01 +0300)]
telepathy: include config.h in more modules

Otherwise GLIB_VERSION_MIN_REQUIRED is not defined, which causes build
failures due to new deprecations in glib-2.0 >= 2.62.0.

4 years agopurple: include config.h in more modules
Stefan Becker [Wed, 28 Aug 2019 20:59:17 +0000 (28 23:59 +0300)]
purple: include config.h in more modules

Otherwise GLIB_VERSION_MIN_REQUIRED is not defined, which causes build
failures due to new deprecations in glib-2.0 >= 2.62.0.

4 years agoconfigure: set min version for glib-2.0 >= 2.62.0
Stefan Becker [Wed, 28 Aug 2019 20:56:10 +0000 (28 23:56 +0300)]
configure: set min version for glib-2.0 >= 2.62.0

- libpurple API uses GParameter, which will be deprecated in 2.62.0.
- telepathy-glib API uses GTimeVal, which will be deprecated in 2.62.0.
- libpurple 2.x API uses G_CONST_RETURN, which has been deprecated since
  2.30.0, but only in 2.62.0 a versioned deprecation has been added.

The configure code now sets GLIB_VERSION_MIN_REQUIRED to the lowest of
2_60, 2_30 or 2_28 depending on what backends are configured in the
build.

4 years agocore: add generic tests module
Stefan Becker [Wed, 28 Aug 2019 16:56:06 +0000 (28 19:56 +0300)]
core: add generic tests module

Start by adding tests for the re-implemented time conversion APIs in
utils module.

4 years agoutils: use GDateTime when glib-2.0 >= 2.56.0
Stefan Becker [Wed, 28 Aug 2019 16:53:09 +0000 (28 19:53 +0300)]
utils: use GDateTime when glib-2.0 >= 2.56.0

GTimeVal and related APIs will be marked as deprecated in 2.62.0.
All APIs we need to implement our functionality using GDateTime are
available since 2.56.0.

4 years agol10n: sync translations with transifex.com (fr, nl, pt, pt_BR, zh_CN)
Stefan Becker [Sat, 17 Aug 2019 11:11:39 +0000 (17 14:11 +0300)]
l10n: sync translations with transifex.com (fr, nl, pt, pt_BR, zh_CN)

4 years agocontrib: remove support for obsolete platforms
Stefan Becker [Thu, 11 Jul 2019 10:04:29 +0000 (11 13:04 +0300)]
contrib: remove support for obsolete platforms

Ubuntu 16.10, 17.04 & 17.10 have reached EOL. As their builds have a new
BR the build will fail, because the packages for those older versions
have been removed and the build will only succeed by accident if the
build system has the packages cached somewhere.

4 years agocore: fix md4sum() stub signature in test
Stefan Becker [Thu, 11 Jul 2019 09:40:07 +0000 (11 12:40 +0300)]
core: fix md4sum() stub signature in test

Now the stub in the test code agrees with the signature in md4sum.h.

4 years agocore: fix -Wmaybe-unitialized warnings
Stefan Becker [Thu, 11 Jul 2019 09:38:50 +0000 (11 12:38 +0300)]
core: fix -Wmaybe-unitialized warnings

Reported by GCC on openSUSE Tumbleweed.

4 years agoadium: add RTF module to build
Stefan Becker [Sun, 7 Jul 2019 13:50:20 +0000 (7 16:50 +0300)]
adium: add RTF module to build

Add sipe-rtf.l to the Xcode build.

The default "System Lex rule" doesn't work for us as it expects the
wrong output file name in the wrong location. Create a custom build
rule using a script that calls $(LEX), which is actually "flex", and
generates files in the derived file directory with our file name
convention.

4 years agopurple-media: fix a gstreamer leak
Fabrice Bellet [Mon, 1 Jul 2019 15:16:35 +0000 (1 17:16 +0200)]
purple-media: fix a gstreamer leak

4 years agoOBS: add freerdp & gssntlmssp for Mageia 7+
Stefan Becker [Tue, 2 Jul 2019 09:47:19 +0000 (2 12:47 +0300)]
OBS: add freerdp & gssntlmssp for Mageia 7+

This enables full appshare & single sign-on experience.

4 years agocontrib: switch to SPDX identifier GPL-2.0-or-later (II)
Stefan Becker [Tue, 2 Jul 2019 09:44:36 +0000 (2 12:44 +0300)]
contrib: switch to SPDX identifier GPL-2.0-or-later (II)

This fixes commit 96832b90503c6cd8248b649bbbec43b65e60594b

Add the missing changelog entries in the SPEC files.

4 years agoOBS: add BR gss-ntlmssp-dev to Debian/Ubuntu
Stefan Becker [Tue, 2 Jul 2019 08:25:52 +0000 (2 11:25 +0300)]
OBS: add BR gss-ntlmssp-dev to Debian/Ubuntu

gss-ntlmssp 0.7.0 is available since Debian 9.0 / Ubuntu 16.04. Update
the DSC files so that users on those systems can enjoy the full single
sign-on experience with SIPE.

4 years agopurple: fix "(null)" login value in finch
Stefan Becker [Tue, 2 Jul 2019 06:30:23 +0000 (2 09:30 +0300)]
purple: fix "(null)" login value in finch

Pidgin works fine with NULL as default login name, but finch returns the
incorrect string "(null)" for it. Change the default to empty string.

4 years agopurple: replace deprecated utility API
Stefan Becker [Mon, 1 Jul 2019 19:25:41 +0000 (1 22:25 +0300)]
purple: replace deprecated utility API

purple_user_dir() has been declared deprecated in the 3.x.x API. Replace
it with purple_config_dir().

I'm not sure if this will break the functionality of the generated
fs-code.conf file, though...

4 years agopurple: update to latest 3.x.x plugin interfaces
Stefan Becker [Mon, 1 Jul 2019 19:09:11 +0000 (1 22:09 +0300)]
purple: update to latest 3.x.x plugin interfaces

4 years agopurple: add wrappers for authorization callbacks
Stefan Becker [Mon, 1 Jul 2019 18:21:43 +0000 (1 21:21 +0300)]
purple: add wrappers for authorization callbacks

The callback type for the purple_account_request_authorization() API has
changed in 3.x.x. It is no longer compatible with the callback type
defined in our core<->backend API.

Hide the differences by introducing a new data structure and wrappers
that ignore the additional parameter introduced in 3.x.x API.

4 years agopurple: remove const from presence/status types
Stefan Becker [Mon, 1 Jul 2019 17:43:58 +0000 (1 20:43 +0300)]
purple: remove const from presence/status types

In 3.x.x API the return types are no longer marked as const. Removing
const is compatible with 2.x.x API.

4 years agopurple: update for action menu API 3.x.x rename
Stefan Becker [Mon, 1 Jul 2019 17:27:25 +0000 (1 20:27 +0300)]
purple: update for action menu API 3.x.x rename

PurpleMenuAction         .> PurpleActionMenu
purple_menu_action_new() -> purple_action_menu_new()

4 years agopurple: add _PurpleProtocolAction fwd declaration
Stefan Becker [Mon, 1 Jul 2019 17:25:00 +0000 (1 20:25 +0300)]
purple: add _PurpleProtocolAction fwd declaration

This fixes most of the compilation errors against latest
3.x.x API.

Add action.h where necessary to get the real type.

4 years agopurple: move D-Bus functionality to 2.x.x API
Stefan Becker [Mon, 1 Jul 2019 16:53:50 +0000 (1 19:53 +0300)]
purple: move D-Bus functionality to 2.x.x API

D-Bus support has been removed from upstream master branch.

4 years agocore: switch to SPDX identifier GPL-2.0-or-later
Stefan Becker [Sun, 30 Jun 2019 14:51:22 +0000 (30 17:51 +0300)]
core: switch to SPDX identifier GPL-2.0-or-later

Newer distros no longer accept the old GPLv2+ identifier.

4 years agopurple: add note about SPDX identifier
Stefan Becker [Sun, 30 Jun 2019 14:49:56 +0000 (30 17:49 +0300)]
purple: add note about SPDX identifier

Unfortunately most appstream versions do not accept the latest
official identifier GPL-2.0-or-later.

4 years agocontrib: switch to SPDX identifier GPL-2.0-or-later
Stefan Becker [Sun, 30 Jun 2019 14:48:35 +0000 (30 17:48 +0300)]
contrib: switch to SPDX identifier GPL-2.0-or-later

Newer distros no longer accept the old GPLv2+ identifier.

4 years agoOBS: disable empathy on newer RPM distros
Stefan Becker [Sun, 30 Jun 2019 13:27:40 +0000 (30 16:27 +0300)]
OBS: disable empathy on newer RPM distros

Fedora 30+ and openSUSE LEAP 15.0+ no longer package empathy. Introduce
flagging into the SPEC file to handle this case.

4 years agoconfigure: document oldest supported LTS releases
Stefan Becker [Sun, 30 Jun 2019 12:57:03 +0000 (30 15:57 +0300)]
configure: document oldest supported LTS releases

Add a table documenting the oldest LTS releases SIPE supports and what
the versions of the main dependencies for SIPE are in those releases.
Also document the EOL for each release.

This should ease the future retirement work.

4 years agocontrib: remove support for obsolete platforms
Stefan Becker [Sun, 30 Jun 2019 12:51:41 +0000 (30 15:51 +0300)]
contrib: remove support for obsolete platforms

Debian 7 and Ubuntu 14.04 have reached EOL.

4 years agopurple: move version check
Stefan Becker [Sun, 30 Jun 2019 12:50:18 +0000 (30 15:50 +0300)]
purple: move version check

The minimum version check is for purple-2, hence it should be in the
purple-2 only code to simplify the flagging.

4 years agotelepathy: add minimum version check
Stefan Becker [Sun, 30 Jun 2019 12:49:33 +0000 (30 15:49 +0300)]
telepathy: add minimum version check

4 years agocontrib: rause BR telepathy-glib >= 0.24.0
Stefan Becker [Sun, 30 Jun 2019 12:46:42 +0000 (30 15:46 +0300)]
contrib: rause BR telepathy-glib >= 0.24.0

Update DEB and RPM files accordingly.

4 years agoconfigure: rause BR telepathy-glib >= 0.24.0
Stefan Becker [Sun, 30 Jun 2019 12:43:47 +0000 (30 15:43 +0300)]
configure: rause BR telepathy-glib >= 0.24.0

Debian 7 & Ubuntu 14.04 have reached end of life, hence we can raise
the BR for telepathy-glib to the lowest common denominator.

4 years agopurple: discard the use of the global stun server
Fabrice Bellet [Fri, 28 Jun 2019 11:27:26 +0000 (28 13:27 +0200)]
purple: discard the use of the global stun server

When the user has configured a stun server in the network perferences of
pidgin, it'll be passed to the farstream backend automatically, and may
generate srflx local candidates, that fail to be nominated by SfB, when
pidgin/sipe is in controlled mode (ie when in the position a receive a
stream from a SfB peer), and behind a NAT-ted network.

ms-client-diagnostics: 21
"Call failed to establish due to a media connectivity
failure where one endpoint is of unknown type"

A supplementary condition is that the NAT does not randomize ports
allocation, so the srflx candidate remains usable during the conncheck.

Just removing the possibily to generate these srflx candidates at
gathering time, by discarding the use of a custom stun server seems to
resolve this issue.  This is not a loss a pairs combinations, because in
the typical situation, the srfx local candidate discovered by the stun
server, is also discovered by the conncheck, as a prflx local candidate
this time.  And a candidate of this type is happily accepted by SfB.

4 years agocore: fix memory leaks
Fabrice Bellet [Fri, 28 Jun 2019 11:27:14 +0000 (28 13:27 +0200)]
core: fix memory leaks

4 years agomedia: schedule a timeout for streams not established yet
Fabrice Bellet [Tue, 18 Jun 2019 21:17:09 +0000 (18 23:17 +0200)]
media: schedule a timeout for streams not established yet

This fixes a bug where adding video to an audio stream caused the
whole session to disconnect after a 30 seconds timeout.

4 years agopurple-media: workaround a heap-use-after-free
Fabrice Bellet [Wed, 12 Jun 2019 16:03:35 +0000 (12 18:03 +0200)]
purple-media: workaround a heap-use-after-free

5 years agocore: make connection debug messages consistent
Stefan Becker [Fri, 22 Mar 2019 07:07:18 +0000 (22 09:07 +0200)]
core: make connection debug messages consistent

Another round to simplify filtering of debug logs:

- rename sip_transport_disconnect -> sip_transport_drop
- remove "dropping connection" text
- always use format '<host>:<port>'(0x<address>)

Example filter strings for the Pidgin debug window:

    _transport_(connected|drop)
    '[a-z0-9.]+:[0-9]+'\(0x[0-9a-f]+\)

5 years agocore: take sipmsg_find_to_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:19:20 +0000 (16 20:19 +0200)]
core: take sipmsg_find_to_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_from_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:16:09 +0000 (16 20:16 +0200)]
core: take sipmsg_find_from_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_expires_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:12:56 +0000 (16 20:12 +0200)]
core: take sipmsg_find_expires_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_event_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:10:39 +0000 (16 20:10 +0200)]
core: take sipmsg_find_event_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_cseq_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:08:16 +0000 (16 20:08 +0200)]
core: take sipmsg_find_cseq_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_content_type_header() into use
Stefan Becker [Sat, 16 Mar 2019 18:02:42 +0000 (16 20:02 +0200)]
core: take sipmsg_find_content_type_header() into use

DRY cleanup.

5 years agocore: take sipmsg_find_call_id_header() into use
Stefan Becker [Sat, 16 Mar 2019 17:54:52 +0000 (16 19:54 +0200)]
core: take sipmsg_find_call_id_header() into use

DRY cleanup.

5 years agosipmsg: add helpers to find common headers
Stefan Becker [Sat, 16 Mar 2019 17:29:57 +0000 (16 19:29 +0200)]
sipmsg: add helpers to find common headers

DRY cleanup

5 years agocore: fix inconsistency in Contact address parsing
Stefan Becker [Sat, 16 Mar 2019 17:11:46 +0000 (16 19:11 +0200)]
core: fix inconsistency in Contact address parsing

Address from Contact header was parsed in 2 places and both were using a
different approach. Added sipmsg_parse_contact_address() API to remove
this inconsistency, similar to the handling of From/To headers.

I also noticed that the address parsing APIs can and should accept a
const struct sipmsg pointer. Updated code accordingly.

5 years agocore: factor out code that adds tag to To: header
Stefan Becker [Sat, 16 Mar 2019 16:57:44 +0000 (16 18:57 +0200)]
core: factor out code that adds tag to To: header

DRY cleanup: the exact same code was repeated in 3 different places.

5 years agoFix #350: Inconsistent parsing of From:/To: headers
Stefan Becker [Wed, 13 Mar 2019 18:50:14 +0000 (13 20:50 +0200)]
Fix #350: Inconsistent parsing of From:/To: headers

sipmsg_breakdown_parse() is now parsing the address out of those fields
like all other places. Message signature verification should now work
also in those cases where URIs are not wrapped in "<...>".

5 years agosipmsg: fix test build error on RHEL6
Stefan Becker [Wed, 13 Mar 2019 18:44:35 +0000 (13 20:44 +0200)]
sipmsg: fix test build error on RHEL6

It complains about missing field initializers.

5 years agosign: fix inconsistency in From/To address parsing
Stefan Becker [Wed, 13 Mar 2019 18:23:11 +0000 (13 20:23 +0200)]
sign: fix inconsistency in From/To address parsing

sipmsg_breakdown_parse() was hard-coded to look for "<...>" wrapped URIs
in the From/To headers. Use parse_from() like all other places. This
means that messages with non-"<...>"-wrapped URIs will now pass message
verification.

5 years agocore: take sipmsg_parse_address_from_header() into use
Stefan Becker [Wed, 13 Mar 2019 18:05:13 +0000 (13 20:05 +0200)]
core: take sipmsg_parse_address_from_header() into use

DRY cleanup. Now only two places outside sipmsg.c are left that call
parse_from() directly.

5 years agocore: take sipmsg_parse_to_address() into use
Stefan Becker [Wed, 13 Mar 2019 17:54:38 +0000 (13 19:54 +0200)]
core: take sipmsg_parse_to_address() into use

DRY cleanup.

5 years agocore: take sipmsg_parse_from_address() into use
Stefan Becker [Wed, 13 Mar 2019 17:46:56 +0000 (13 19:46 +0200)]
core: take sipmsg_parse_from_address() into use

DRY cleanup.

5 years agosipmsg: add parse address from header APIs
Stefan Becker [Wed, 13 Mar 2019 17:36:55 +0000 (13 19:36 +0200)]
sipmsg: add parse address from header APIs

Start of DRY cleanup for parse_from(sipmsg_find_header(...)) code.

- generic API    sipmsg_parse_address_from_header()
- special cases: sipmsg_parse_(from|to)_address()

5 years agosipmsg: add tests for P-Asserted-Identity parsing
Stefan Becker [Wed, 13 Mar 2019 17:35:32 +0000 (13 19:35 +0200)]
sipmsg: add tests for P-Asserted-Identity parsing

Convert the examples in the sipmsg.h comments to real tests.

5 years agosipmsg: add test program for message tests
Stefan Becker [Tue, 12 Mar 2019 18:04:48 +0000 (12 20:04 +0200)]
sipmsg: add test program for message tests

Factor out non-NTLM tests from sip-sec-ntlm-tests.c to the new tester
sipe-sipmsg-tests.c. Those tests should always be executed, even when
SIPE NTLM implementation isn't compiled in.

5 years agortf: fix tests for older C compilers
Stefan Becker [Sat, 29 Dec 2018 13:46:37 +0000 (29 15:46 +0200)]
rtf: fix tests for older C compilers

Move the variable definition out of the for loop.

5 years agortf: fix build error in NTLM tests
Stefan Becker [Sat, 29 Dec 2018 13:33:50 +0000 (29 15:33 +0200)]
rtf: fix build error in NTLM tests

NTLM tests include sipmsg.c which now depends on sipe-rtf.c

5 years agortf: rewrite state initialization
Stefan Becker [Sat, 29 Dec 2018 13:31:07 +0000 (29 15:31 +0200)]
rtf: rewrite state initialization

On some platforms GCC requires to initialize all fields, even the ones
that don't need it. Rewrite the initialization to only set those state
fields that require it.

5 years agortf: fix build error on Windows
Stefan Becker [Sat, 29 Dec 2018 09:25:26 +0000 (29 11:25 +0200)]
rtf: fix build error on Windows

This fixes commit d7faa8e036db6b9495f08d03e4e5bdfe5ab6b483

5 years agoFeature #77: RTF support (incoming)
Stefan Becker [Fri, 28 Dec 2018 22:59:59 +0000 (29 00:59 +0200)]
Feature #77: RTF support (incoming)

Instead of showing an error message to the user we now extract the plain
text from incoming RTF and pass it as HTML to the backend.

5 years agoincoming: allow MIME type text/rtf
Stefan Becker [Fri, 28 Dec 2018 22:47:49 +0000 (29 00:47 +0200)]
incoming: allow MIME type text/rtf

get_html_message() now knows hwo to transform it to HTML.

5 years agosipmsg: take sipe_rtf_to_html() into use
Stefan Becker [Fri, 28 Dec 2018 22:30:32 +0000 (29 00:30 +0200)]
sipmsg: take sipe_rtf_to_html() into use

Convert MIME type text/rtf to HTML in get_html_message().

5 years agortf: add helper functions to tests
Stefan Becker [Fri, 28 Dec 2018 21:57:50 +0000 (28 23:57 +0200)]
rtf: add helper functions to tests

Now the RTF tests compile and pass.

5 years agortf: take parser function into use
Stefan Becker [Fri, 28 Dec 2018 21:55:50 +0000 (28 23:55 +0200)]
rtf: take parser function into use

This completes the initial implementation for the RTF module.

5 years agortf: add parser function
Stefan Becker [Fri, 28 Dec 2018 21:26:33 +0000 (28 23:26 +0200)]
rtf: add parser function

A simple parser function, based on a Bison parser, that processes RTF
keywords. It currently only recognizes the following two keywords

- \uc<N> - N replacement characters after Unicode keyword (\u)
- \par   - paragraph, transformed to HTML <br/>

Everything else is ignored.

5 years agortf: add lexer rules
Stefan Becker [Fri, 28 Dec 2018 18:48:18 +0000 (28 20:48 +0200)]
rtf: add lexer rules

- consume anything that we do not want to parse
- plain text and characters are added directly to the output buffer
- RTF keywords and parameters are passed to the parser

5 years agortf: add tests for RTF to HTML transform
Stefan Becker [Fri, 28 Dec 2018 18:22:28 +0000 (28 20:22 +0200)]
rtf: add tests for RTF to HTML transform

5 years agortf: add memory allocation code for lexer
Stefan Becker [Fri, 28 Dec 2018 18:00:53 +0000 (28 20:00 +0200)]
rtf: add memory allocation code for lexer

We use the flex options noyyalloc/noyyfree/noyyrealloc to be able to
provide a memory allocation implementation based on glib2.

5 years agoFix file mode flags
Stefan Becker [Fri, 28 Dec 2018 17:30:54 +0000 (28 19:30 +0200)]
Fix file mode flags

Remove execute flag from files that do not need it.

5 years agortf: add module for RTF processing
Stefan Becker [Fri, 28 Dec 2018 11:16:58 +0000 (28 13:16 +0200)]
rtf: add module for RTF processing

This adds a function to extract plain text from RTF and convert it to
HTML. The implementation will use a flex-based lexer and a hand-written
parser.

Start off by adding the lexer module and integrating it to the build.
The release tarball will include the pre-generated lexer C code, i.e.
the flex tool is not required for a normal build. Update the
documentation accordingly.

5 years agoFeature #107: Provide idle start time for a buddy
Stefan Becker [Sun, 2 Dec 2018 16:43:04 +0000 (2 18:43 +0200)]
Feature #107: Provide idle start time for a buddy

The value of the optional "lastActive" attribute in a presence
notification is now parsed and passed down as seconds since epoch
timestamp to the backend.

User visible changes in the Pidgin UI:
* idle users are now "greyed out" like offline users
* idle timers now work when "Show" -> "Idle Times" is enabled

5 years agonotify: parse lastActive attribute from state node
Stefan Becker [Sun, 2 Dec 2018 16:33:30 +0000 (2 18:33 +0200)]
notify: parse lastActive attribute from state node

Buddy presence "application/msrtc-event-categories+xml" does have an
optional attribute "lastActive" in the categories/category/state XML
node that indicates when the buddy entered the current idle state.
Parse the contents of that attribute as ISO8601 timestamp and pass it
to sipe_core_buddy_got_status().

5 years agopurple: update for sipe_core_buddy_got_status()
Stefan Becker [Sun, 2 Dec 2018 16:14:15 +0000 (2 18:14 +0200)]
purple: update for sipe_core_buddy_got_status()

Purple backend calls this API to implement a workaround. Use 0 for the
last_active value, i.e. "unknown when buddy entered idle state".

5 years agobuddy: update sipe_core_buddy_got_status() API
Stefan Becker [Sun, 2 Dec 2018 16:13:14 +0000 (2 18:13 +0200)]
buddy: update sipe_core_buddy_got_status() API

Add a new time_t parameter that provides an indication to the backend
when the buddy has entered the current idle state. This parameter is
only valid when the "activity" indicates an idle state. The parameter
may be 0 if it is unknown when the buddy entered the idle state or he
is not idle.

Pass the new parameter down to sipe_backend_buddy_set_status().

5 years agomiranda: update sipe_backend_buddy_set_status()
Stefan Becker [Sun, 2 Dec 2018 16:00:05 +0000 (2 18:00 +0200)]
miranda: update sipe_backend_buddy_set_status()

Add new last_active as unused parameter.

5 years agotelepathy: update sipe_backend_buddy_set_status()
Stefan Becker [Sun, 2 Dec 2018 15:58:25 +0000 (2 17:58 +0200)]
telepathy: update sipe_backend_buddy_set_status()

Add new last_activity as unused parameter.