r3716 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src/phone-kit

chris at sita.openmoko.org chris at sita.openmoko.org
Fri Dec 21 14:00:42 CET 2007


Author: chris
Date: 2007-12-21 14:00:39 +0100 (Fri, 21 Dec 2007)
New Revision: 3716

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms-dbus.xml
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.h
Log:
        * src/phone-kit/moko-network.c: (gsmd_eventhandler):
        Send all delivery status events

        * src/phone-kit/moko-sms-dbus.xml:
        Make delivery status report optional

        * src/phone-kit/moko-sms.c: (on_incoming_ds), (on_send_sms),
        (moko_sms_send):
        * src/phone-kit/moko-sms.h:
        Filter delivery status types correctly (hopefully), make delivery status
        report optional


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-12-21 12:58:14 UTC (rev 3715)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-12-21 13:00:39 UTC (rev 3716)
@@ -1,3 +1,17 @@
+2007-12-21  Chris Lord  <chris at openedhand.com>
+
+	* src/phone-kit/moko-network.c: (gsmd_eventhandler):
+	Send all delivery status events
+
+	* src/phone-kit/moko-sms-dbus.xml:
+	Make delivery status report optional
+
+	* src/phone-kit/moko-sms.c: (on_incoming_ds), (on_send_sms),
+	(moko_sms_send):
+	* src/phone-kit/moko-sms.h:
+	Filter delivery status types correctly (hopefully), make delivery status
+	report optional
+
 2007-12-19  Chris Lord  <chris at openedhand.com>
 
 	* src/phone-kit/moko-sms.c: (note_added_cb), (note_modified_cb):

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c	2007-12-21 12:58:14 UTC (rev 3715)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c	2007-12-21 13:00:39 UTC (rev 3716)
@@ -383,14 +383,9 @@
     if (aux->u.ds.inlined) {
       struct gsmd_sms_list *sms = (struct gsmd_sms_list *) aux->data;
       
-      /* TODO: I'm not entirely sure of the spec when if 
-       *       storing an unsent message means it failed?
-       */
-      if (sms->payload.coding_scheme == LGSM_SMS_STO_SENT) {
-        for (l = priv->listeners; l; l = l->next) {
-          moko_listener_on_incoming_ds (MOKO_LISTENER (l->data), priv->handle,
-                                        sms);
-        }
+      for (l = priv->listeners; l; l = l->next) {
+        moko_listener_on_incoming_ds (MOKO_LISTENER (l->data), priv->handle,
+                                      sms);
       }
     } else {
       g_warning ("Delivery status report not in-line, left unhandled");

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms-dbus.xml
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms-dbus.xml	2007-12-21 12:58:14 UTC (rev 3715)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms-dbus.xml	2007-12-21 13:00:39 UTC (rev 3716)
@@ -8,6 +8,7 @@
   <method name="Send">
     <arg type="s" name="number" />
     <arg type="s" name="message" />
+    <arg type="b" name="report" />
     <arg type="s" name="uid" direction="out" />
   </method>
 

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c	2007-12-21 12:58:14 UTC (rev 3715)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.c	2007-12-21 13:00:39 UTC (rev 3716)
@@ -349,7 +349,10 @@
   MokoSms *moko_sms = MOKO_SMS (listener);
   MokoSmsPrivate *priv = moko_sms->priv;
 
-  if (sms->payload.coding_scheme == LGSM_SMS_STO_SENT) {
+  /* TODO: I'm not entirely sure of the spec when if 
+   *       storing an unsent message means it failed?
+   */
+  if (sms->stat == GSMD_SMS_STO_SENT) {
     gchar *ref = g_strdup_printf ("%d", sms->index);
     JanaStoreView *view = jana_store_get_view (priv->sms_store);
     MokoSmsStatusReport *sr = g_slice_new (MokoSmsStatusReport);
@@ -386,6 +389,8 @@
     } else {
       g_debug ("Sent message rejected");
       jana_utils_component_remove_category (JANA_COMPONENT(priv->last_msg),
+                                            "Sent");
+      jana_utils_component_remove_category (JANA_COMPONENT(priv->last_msg),
                                             "Sending");
       jana_utils_component_insert_category (JANA_COMPONENT(priv->last_msg),
                                             "Rejected", 0);
@@ -602,7 +607,8 @@
 
 gboolean
 moko_sms_send (MokoSms *self, const gchar *number,
-               const gchar *message, gchar **uid, GError **error)
+               const gchar *message, gboolean report, gchar **uid,
+               GError **error)
 {
   PhoneKitNetworkStatus status;
   struct lgsm_handle *handle;
@@ -637,7 +643,7 @@
     return FALSE;
   
   /* Ask for delivery report */
-  sms.ask_ds = 1;
+  sms.ask_ds = report ? 1 : 0;
   
   /* Set destination number */
   if (strlen (number) > GSMD_ADDR_MAXLEN + 1) {
@@ -693,8 +699,13 @@
   g_free (sub_num);
   
   jana_note_set_body (note, message);
-  jana_component_set_categories (JANA_COMPONENT (note),
-    (const gchar *[]){ "Sending", NULL});
+  if (report) {
+    jana_component_set_categories (JANA_COMPONENT (note),
+                                   (const gchar *[]){ "Sending", NULL});
+  } else {
+    jana_component_set_categories (JANA_COMPONENT (note),
+                                   (const gchar *[]){ "Sent", NULL});
+  }
   
   jana_store_add_component (priv->sms_store,
     JANA_COMPONENT (note));
@@ -702,9 +713,8 @@
   
   if (priv->last_msg) {
     g_warning ("Confirmation not received for last sent SMS, "
-      "delivery report will be lost.");
+               "any delivery reports for this message will be lost.");
     g_object_unref (priv->last_msg);
-    priv->last_msg = NULL;
   }
   priv->last_msg = note;
   

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.h	2007-12-21 12:58:14 UTC (rev 3715)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-sms.h	2007-12-21 13:00:39 UTC (rev 3716)
@@ -96,7 +96,8 @@
 /* SMS interface */
 gboolean
 moko_sms_send (MokoSms *self, const gchar *number,
-               const gchar *message, gchar **uid, GError **error);
+               const gchar *message, gboolean report, gchar **uid,
+               GError **error);
 
 G_END_DECLS
 





More information about the commitlog mailing list