David Woodhouse [Mon, 11 Dec 2017 15:42:28 +0000 (15:42 +0000)]
Let fs-app-transmitter launch a pipeline by its description
Instead of hard-coded audiotestsrc/filesink, let the pipeline descriptions
get passed in in the FsCandidate's 'host' and 'username' fields, much as
the FsShmTransmitter does for the filenames.
This might not last, as we can only reference named elements in a pipeline
description if they were created in that same pipeline, AFAICT. So my plan
of pre-creating the appsrc and then referencing it from the description
probably isn't going to work.
Which means we might end up with a dedicated FsChimeTransmitter after all,
but hey, at least I have a better understanding of how some of this stuff
fits together...
David Woodhouse [Sat, 9 Dec 2017 09:01:06 +0000 (09:01 +0000)]
Start cleaning up audio support, handle mute
There are locking issues here. The appsink_new_sample() function can get
invoked from another thread, which means it can race with the timer.
I think if the g_source_remove() in do_send_rt_packet() runs while a
timed_send_rt_packet() is waiting for the rt_lock, it can deadlock.
The simple fix is probably to shift all the actual packet processing into
a separate thread with a simple packet-sending loop which does both audio
and muted frames.
Or maybe we don't want a thread wakeup to add to the outbound packet
latency, and we'll allow appsink_new_sample() to send directly for itself
with some simple locking scheme between it and the thread.
The thread can then handle DTLS and auth and everything else sequentially,
which lets me do DTLS "natively" with GnuTLS and saves me from lamenting
the absence of GDtlsClientConnection too much.
Guilherme Melo [Sat, 25 Nov 2017 16:22:06 +0000 (18:22 +0200)]
Fix attachment messages when the user sends it from other clients
On an IM conversation between "A" and "B", if "A" sent an attachment
from other client (e.g. Web), "A" would see the message on pidgin as
being sent by "B".
Also "A" would receive a notification from pidgin for its own
attachments.
David Woodhouse [Wed, 6 Dec 2017 16:37:41 +0000 (16:37 +0000)]
Call cleanup
Split out chime-call-transport.c so we can add DTLS more easily. Deal with
opening/closing the "Call Participants" window by adding a chat menu, which
will also be the basis for starting an audio call.
David Woodhouse [Tue, 5 Dec 2017 13:34:32 +0000 (13:34 +0000)]
Fix support for more than 100 contacts
Oh joy, there's a completely separate way to handle fetching of contacts
in stages. The 'NextToken' is in a special header instead of in the JSON
response, but ultimately it's very similar. Make fetch_contacts() work
like fetch_conversations() and fetch_rooms() do.
This fixes the disappearance of contacts, when you have more than 100.
Which was partly masked by the fact that we weren't deleting the buddies
from Pidgin.
David Woodhouse [Tue, 5 Dec 2017 13:32:10 +0000 (13:32 +0000)]
Fix buddy removal when they're no longer in the contacts list
We're supposed to remove purple buddies when they are no longer in the
contacts list, but we weren't removing them if they were visible to us
at all (by virtue of being in a conversation or a room).
David Woodhouse [Tue, 5 Dec 2017 13:30:04 +0000 (13:30 +0000)]
Explicitly close ChimeConnection in chime_purple_close()
Instead of allowing it to be implicitly closed by the final unref, close
it explicitly. This allows us to fix up the refcounting elsewhere, so
the objects associated with the connection can just hold a ref to it.
It was kind of OK for rooms/conversations but it's getting silly with
meetings adn calls.
Isaac Jurado [Thu, 16 Nov 2017 11:22:34 +0000 (12:22 +0100)]
Escape the "|" character in GWT requests.
Apart from the backslash "\", the pipe character "|" also needs to be escaped
for obvious reasons. Not escaping it breaks the format of the GWT requests.
Nicola Girardi [Wed, 25 Oct 2017 22:22:29 +0000 (23:22 +0100)]
Initial support for receiving attachments
- uses purple_util_fetch_url_len() rather than hijacking the soup session
- saves attachments in $HOME/.purple/chime-purple/$email/downloads
- displays attachment in the chat or conversation if content type is image
- notifies of downloaded file if attachment is not an image
- does *not* handle variants
David Woodhouse [Tue, 7 Nov 2017 04:55:43 +0000 (05:55 +0100)]
Remove 'wait-for-connection' property
Now we should have FsAppTransmitter "working", at least with the
audiotestsrc and filesink for now. Hooking it up to an actual
appsrc/appsink and to paulbohm's code remains to be done...
David Woodhouse [Fri, 3 Nov 2017 08:30:52 +0000 (08:30 +0000)]
Not working with filesink
The fsappbin1 bin never entes the PLAYING state, for some reason. Hopefully
I can get a coherent response to
https://lists.freedesktop.org/archives/farstream-devel/2017-November/000079.html
David Woodhouse [Wed, 18 Oct 2017 14:49:54 +0000 (15:49 +0100)]
Abort connection when server kicks us off
Oops, this snuck in with another commit. I'm willing to rewrite
history to fix that, even though I wouldn't do it to fix the stupid
"calender" typo that inexplicably slipped in last week.
David Woodhouse [Fri, 15 Sep 2017 02:01:17 +0000 (19:01 -0700)]
Flesh out the DataMessage stuff a little more.
Definitely needs a lot more testing. I did manage to see two fragments in
a real call today, rather than the single frag that I get in my test
Instant Meetings. But this is crying out for a proper set of test cases...
David Woodhouse [Thu, 14 Sep 2017 18:47:30 +0000 (11:47 -0700)]
Prefer conversations with peers that have fully-populated profiles
Where we have multiple conversations with the same peer email address
because there are multiple profiles with that email address, prefer
(for outbound messages) the profile that has a meaningful display_name
field rather than just a copy of the email address.
David Woodhouse [Thu, 14 Sep 2017 17:26:55 +0000 (10:26 -0700)]
Fix crash when multiple conversations exist with the same peer email address
There can be more than one profile for a given email address. You can have
conversations with both profiles. I don't know how this happens, but I've
seen the aftermath.
This was causing the first 'im' structure to be destroyed when the second
was discovered, which caused a use-after-free because I haven't yet
converted the chime_im/chime_room/chime_msgs stuff to proper GOBjects
and refcounted them, and the fetch_messages call was still pending.
For a quick "fix", keep them around by having a hash table on profile_id
too.
David Woodhouse [Thu, 14 Sep 2017 13:40:25 +0000 (06:40 -0700)]
Decode RT messages, extract audio
We really need to work out how to get this hooked up to Pidgin now;
we *have* the audio data and if we #define AUDIO_HACKS we can play it
back.
It still kicks us off as we're not sending any but the first message,
but once we have audio data to send that'll be fixed. Need to set up
a periodic empty message even if we're muted though.
David Woodhouse [Wed, 13 Sep 2017 21:59:30 +0000 (14:59 -0700)]
Audio calls actually connecting
Needs cleanup and object lifetime handling taken into account, but
progress nonetheless. Someone needs to work out how to use
fsrawconference (presumably) to allow us to actually pass the audio
to Pidgin to be heard, instead of just spewing it to stdout.
David Woodhouse [Mon, 11 Sep 2017 21:12:20 +0000 (14:12 -0700)]
Import tincan protobuf definitions
We will probably end up doing this differently — partly because we might
be able to use a GLib-based protobuf encoder/decoder which fits more
neatly, and partly because we don't *want* to be lifting things from
internal code even if it's just the protocol definitions in a standard
form. But this is the easy option for now....
David Woodhouse [Mon, 11 Sep 2017 20:03:10 +0000 (13:03 -0700)]
Use soup_session_websocket_connect_async() again
This mostly reverts commit b767104a2a1 ("Open-code replacement for
soup_session_websocket_connect_async()"). That was reasonable enough
when we only had one websocket. Now we're going to have more, so lift
the original one and hack it to work with our ChimeWebsocketConnection
too.
Michael Gruenewald [Mon, 11 Sep 2017 13:34:11 +0000 (15:34 +0200)]
Improve group conversation naming
Before, group conversations were named by concatenating member names
using just `,`. With our peculiar member names that resulted in
conversation names like
Last1, First1,Last2, First2
which hurts the typographical part of my brain. With semicolons and an
extra space it looks like that:
David Woodhouse [Fri, 8 Sep 2017 20:42:47 +0000 (21:42 +0100)]
Try to improve chat room handling in buddy list / room list
Attempt to keep names up to date and use RoomId instead of name to be
unambiguous where we can. Not entirely sure I like this but I didn't
much like it before, either...