Logo Search packages:      
Sourcecode: jabberd2 version File versions  Download package

void sm_c2s_action ( sess_t  dest,
char *  action,
char *  target 
)

send a new action route

Definition at line 270 of file sm.c.

References sess_st::c2s, sess_st::c2s_id, sm_st::id, _sx_st::nad_cache, sm_st::router, user_st::sm, sess_st::sm_id, and sess_st::user.

Referenced by user_delete().

                                                            {
    nad_t nad;
    int rns, sns;

    nad = nad_new(dest->user->sm->router->nad_cache);

    rns = nad_add_namespace(nad, uri_COMPONENT, NULL);
    nad_append_elem(nad, rns, "route", 0);

    nad_append_attr(nad, -1, "to", dest->c2s);
    nad_append_attr(nad, -1, "from", dest->user->sm->id);

    sns = nad_add_namespace(nad, uri_SESSION, "sc");
    nad_append_elem(nad, sns, "session", 1);

    if(dest->c2s_id[0] != '\0')
        nad_append_attr(nad, sns, "c2s", dest->c2s_id);
    if(dest->sm_id[0] != '\0')
        nad_append_attr(nad, sns, "sm", dest->sm_id);

    nad_append_attr(nad, -1, "action", action);
    if(target != NULL)
        nad_append_attr(nad, -1, "target", target);

    log_debug(ZONE, "routing nad to %s from %s c2s %s s2s %s action %s target %s", dest->c2s, dest->user->sm->id, dest->c2s_id, dest->sm_id, action, target);

    sx_nad_write(dest->user->sm->router, nad);
}


Generated by  Doxygen 1.6.0   Back to index