コード例 #1
0
static void
ring_text_manager_receive_deliver(RingTextManager *self,
  SMSGDeliver *deliver)
{
  RingTextManagerPrivate *priv = self->priv;
  RingTextChannel *channel;

  char const *originator = sms_g_deliver_get_originator(deliver);
  glong delivered = sms_g_deliver_get_delivered(deliver);

  DEBUG("SMS-DELIVER from %s%s", originator, delivered ? " from spool" : "");

  if (!ring_text_channel_can_handle(deliver)) {
    DEBUG("cannot handle, ignoring");
    return;
  }

  if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
    DEBUG("not yet connected, ignoring");
    return;
  }

  int class0 = sms_g_deliver_get_sms_class(deliver) == 0;

  channel = get_text_channel(self, originator, class0, 0);

  if (channel)
    ring_text_channel_receive_deliver(channel, deliver);
}
コード例 #2
0
static void
ring_text_manager_receive_status_report(RingTextManager *self,
		  char const *destination,
		  char const *token,
		  gboolean const *success)
{
  RingTextManagerPrivate *priv = self->priv;
  RingTextChannel *channel;

  if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
    /* Uh-oh */
    DEBUG("not yet connected, ignoring");
    return;
  }

  channel = get_text_channel(self, destination, 0, 0);

  if (channel)
    ring_text_channel_receive_status_report(channel, token, success);
}
コード例 #3
0
static void
on_immediate_message (ModemSMSService *sms,
                      gchar const *message,
                      GHashTable *info,
                      gpointer _self)
{
  RingTextManager *self = RING_TEXT_MANAGER (_self);
  char const *sender;
  RingTextChannel *channel;

  g_return_if_fail (info != NULL);
  g_return_if_fail (message != NULL);

  sender = tp_asv_get_string (info, "Sender");
  g_return_if_fail (sender != NULL);

  channel = get_text_channel (self, sender, 0, 0);
  g_return_if_fail (channel != NULL);

  receive_text (self, channel, message, info, 0);
}
コード例 #4
0
static void
ring_text_manager_receive_status_report(RingTextManager *self,
  SMSGStatusReport *status_report)
{
  RingTextManagerPrivate *priv = self->priv;
  RingTextChannel *channel;

  char const *recipient = sms_g_status_report_get_recipient(status_report);

  DEBUG("SMS-STATUS_REPORT for %s", recipient);

  if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
    /* Uh-oh */
    DEBUG("not yet connected, ignoring");
    return;
  }

  channel = get_text_channel(self, recipient, 0, 0);

  if (channel)
    ring_text_channel_receive_status_report(channel, status_report);
}
コード例 #5
0
static void
on_sms_service_outgoing_complete(ModemSMSService *service,
  char const *destination,
  char const *token,
  gpointer _self)
{
  RingTextManager *self = _self;
  RingTextManagerPrivate *priv = self->priv;
  RingTextChannel *channel;

  DEBUG("Outgoing complete to %s with %s", destination, token);

  if (priv->cstatus != TP_CONNECTION_STATUS_CONNECTED) {
    DEBUG("not yet connected, ignoring");
    return;
  }

  channel = get_text_channel(self, destination, 0, 1);

  if (channel)
    ring_text_channel_outgoing_sms_complete(channel, token);
}