jingle/action-handlers.c
changeset 111 76ce876f7935
parent 109 d4d50e62098b
child 114 813867884159
equal deleted inserted replaced
110:c0341c164405 111:76ce876f7935
   334     scr_LogPrint(LPRINT_LOGNORM, "%s", sbuf->str);
   334     scr_LogPrint(LPRINT_LOGNORM, "%s", sbuf->str);
   335   }
   335   }
   336   g_free(disp);
   336   g_free(disp);
   337 }
   337 }
   338 
   338 
       
   339 void handle_session_info(JingleNode *jn)
       
   340 {
       
   341   JingleSession *sess;
       
   342   SessionContent *sc;
       
   343   GSList *el;
       
   344 
       
   345   if ((sess = session_find(jn)) == NULL) {
       
   346     jingle_send_iq_error(jn->message, "cancel", "item-not-found", "unknown-session");
       
   347     return;
       
   348   }
       
   349 
       
   350   /* "If either party receives an empty session-info message
       
   351    * for an active session, it MUST send an empty IQ result;
       
   352    * this usage functions as a "ping" to determine session
       
   353    * vitality via the XMPP signalling channel." */
       
   354   if (jn->node->children == NULL) {
       
   355     jingle_ack_iq(jn->message);
       
   356     return;
       
   357   }
       
   358 
       
   359   /* We don't know the app to which the message is addressed.
       
   360    * Only the app module itself may know, based on the element
       
   361    * name and its xmlns, so we need to try every app module. */
       
   362   for (el = sess->content; el; el = el->next) {
       
   363     sc = (SessionContent*)el->data;
       
   364     if (sc->appfuncs->handle == NULL)
       
   365       continue;
       
   366 
       
   367     if (sc->appfuncs->handle(JINGLE_SESSION_INFO, sc->description,
       
   368                              jn->node->children)) {
       
   369       jingle_ack_iq(jn->message);
       
   370       return;
       
   371 	}
       
   372   }
       
   373   /* "If the party that receives an informational message
       
   374    * does not understand the payload, it MUST return a
       
   375    * <feature-not-implemented/> error with a Jingle-specific
       
   376    * error condition of <unsupported-info/>." */
       
   377   jingle_send_iq_error(jn->message, "modify", "feature-not-implemented",
       
   378                        "unsupported-info");
       
   379 }
       
   380 
   339 void handle_session_accept(JingleNode *jn)
   381 void handle_session_accept(JingleNode *jn)
   340 {
   382 {
   341   JingleSession *sess;
   383   JingleSession *sess;
   342   JingleContent *jc;
   384   JingleContent *jc;
   343   SessionContent *sc;
   385   SessionContent *sc;