Fix messages on self-initiated channels

This commit is contained in:
2020-05-21 11:06:07 +01:00
parent d77d04e9b1
commit efe97a33c4
3 changed files with 18 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ Here's where we're at right now:
- [x] Appear as online in Empathy
- [x] Disconnect!
- [ ] Set up an account manually
- [ ] Contacts handling
- [~] Contacts handling
- [x] Text messages
- [ ] Multimedia messages
- [ ] Setup messages
@@ -103,12 +103,15 @@ the binary into `/usr/lib/telepathy/telepathy-padfoot`.
I should probably put this into the makefile.
### Running
D-Bus activation is not enabled yet, since it gets in the way of disaster-driven
development. Just run the `telepathy-padfoot` binary as the same user that your
chat client will be running as. It registers to the DBUS **session bus**, and
will be picked up next time your chat client scans (which may need a restart).
### Autogenerated telepathy DBUS bindings
It makes use of the `dbus-codegen-rust` crate to convert the
[telepathy interface specs](https://github.com/TelepathyIM/telepathy-spec) into
the executable code in `src/telepathy`. This is checked in, but can be

View File

@@ -79,6 +79,14 @@ impl Channel {
"org.freedesktop.Telepathy.Channel.TargetHandleType".to_string(),
var_u32(self.handle_type()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.InitiatorHandle".to_string(),
var_u32(self.initiator_handle),
);
out.insert(
"org.freedesktop.Telepathy.Channel.InitiatorID".to_string(),
var_str(self.initiator_contact().unwrap().get_addr().to_string()),
);
out.insert(
"org.freedesktop.Telepathy.Channel.TargetHandle".to_string(),
var_u32(self.target_handle),

View File

@@ -390,10 +390,10 @@ impl Connection {
) {
// Ignore messages that are self-originated.
// FIXME: special-case self-chats
// if msg.get_from_id() == dc::constants::DC_CONTACT_ID_SELF {
// println!("from ourselves, skipping");
// continue;
// }
if msg.get_from_id() == dc::constants::DC_CONTACT_ID_SELF {
println!("from ourselves, skipping");
continue;
}
let parts = convert_msg(&msg);