Handling of SMS messages
Anant Kamath
kamathanant at gmail.com
Mon Sep 2 19:04:17 UTC 2013
Hi,
I've been working on a connection manager for SMS
messaging<http://quickgit.kde.org/?p=scratch/kamath/telepathy-pintxo.git>through
ModemManager as a GSoC project. By now the CM allows you to send
and receive messages.
We're looking to have a discussion and reach a consensus on how to
implement a part of the CM, basically how received SMS messages should be
handled, given the slightly unusual nature of SMS messaging as against
regular IM messaging.
So how it works is,
All received SMS messages are stored on the SIM card/modem.
When the modem receives a message while I'm connected, it emits a signal
and we add it as a recieved message in Tp.
If someone sends me a message when my modem is disconnected, the message
actually 'reaches' the modem only after it goes online.
So the modem (ModemManager) emits 'new message received' signals for all
such messages right after the modem goes online.
Currently what the CM does is that all SMS messages are fetched from the
SIM/Modem store upon the account going online, marked as scrollback, and
added as received messages. And any new messages received via signals are
subsequently added/displayed.
The rationale behind fetching all messages from the modem store everytime
upon (the account) going online is :
1) To make the interface similar to (smart)phones wherein I can typically
always see the entire message threads between me and contacts. (Unlike
say, FB or google chat where previous conversation history is not displayed
in text-ui).
2) To ensure the CM always keeps track of all the messages, which is not
possible by watching for the new message signals alone. For example, if the
modem is plugged and connected to a different computer, or the SIM is
switched between the modem and a phone, I might miss new messages if the CM
don't scan all messages while connecting.
But this has the following problem:
Even though these messages fetched at connection time are marked as
scrollback, KTp emits a notification (New message received..) even though
these messages are just my old messages.
Even if we fix ktp to stop it from notifying us of scrollback messages (and
just notify us of the genuinely new messages received): There's another
problem. If there is a delay between the modem going online and the Tp
account going online, we miss the signals for the new messages and instead
they too get marked as scrollback. So we end up losing notifications for
new messages received in this duration (between the modem and the Tp
account going online).
The alternative I see is to have some sort of message 'sync' routine when
the modem goes online:
1)Scan all messages from the modem store when the account goes online.
2)Check if there are any new messages which are not there in the logger.
Except for these 'new' messages, mark all others as scrollback (and we
still need the fix to prevent notifications for scrollback messages).
3)Listen for signals for newer messages as usual.
This is all assuming that we agree that displaying the entire message
thread (history) in text-ui for SMS messages is the right way to go.
Is there a better alternative?
--
Anant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20130903/e3edc483/attachment-0001.html>
More information about the KDE-Telepathy
mailing list