libpurple/protocols/jabber/jingle/session.c

branch
soc.2013.gobjectification.plugins
changeset 36951
6e23992964ed
parent 36889
4dfe09057bed
parent 35061
307195f879f3
child 36958
2ab9fcc7ca7c
equal deleted inserted replaced
36950:5dbe8b930aef 36951:6e23992964ed
80 g_object_class_install_property(gobject_class, PROP_SID, 80 g_object_class_install_property(gobject_class, PROP_SID,
81 g_param_spec_string("sid", 81 g_param_spec_string("sid",
82 "Session ID", 82 "Session ID",
83 "The unique session ID of the Jingle Session.", 83 "The unique session ID of the Jingle Session.",
84 NULL, 84 NULL,
85 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); 85 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
86 86
87 g_object_class_install_property(gobject_class, PROP_JS, 87 g_object_class_install_property(gobject_class, PROP_JS,
88 g_param_spec_pointer("js", 88 g_param_spec_pointer("js",
89 "JabberStream", 89 "JabberStream",
90 "The Jabber stream associated with this session.", 90 "The Jabber stream associated with this session.",
91 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); 91 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
92 92
93 g_object_class_install_property(gobject_class, PROP_REMOTE_JID, 93 g_object_class_install_property(gobject_class, PROP_REMOTE_JID,
94 g_param_spec_string("remote-jid", 94 g_param_spec_string("remote-jid",
95 "Remote JID", 95 "Remote JID",
96 "The JID of the remote participant.", 96 "The JID of the remote participant.",
97 NULL, 97 NULL,
98 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); 98 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
99 99
100 g_object_class_install_property(gobject_class, PROP_LOCAL_JID, 100 g_object_class_install_property(gobject_class, PROP_LOCAL_JID,
101 g_param_spec_string("local-jid", 101 g_param_spec_string("local-jid",
102 "Local JID", 102 "Local JID",
103 "The JID of the local participant.", 103 "The JID of the local participant.",
104 NULL, 104 NULL,
105 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); 105 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
106 106
107 g_object_class_install_property(gobject_class, PROP_IS_INITIATOR, 107 g_object_class_install_property(gobject_class, PROP_IS_INITIATOR,
108 g_param_spec_boolean("is-initiator", 108 g_param_spec_boolean("is-initiator",
109 "Is Initiator", 109 "Is Initiator",
110 "Whether or not the local JID is the initiator of the session.", 110 "Whether or not the local JID is the initiator of the session.",
111 FALSE, 111 FALSE,
112 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); 112 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
113 113
114 g_object_class_install_property(gobject_class, PROP_STATE, 114 g_object_class_install_property(gobject_class, PROP_STATE,
115 g_param_spec_boolean("state", 115 g_param_spec_boolean("state",
116 "State", 116 "State",
117 "The state of the session (PENDING=FALSE, ACTIVE=TRUE).", 117 "The state of the session (PENDING=FALSE, ACTIVE=TRUE).",
118 FALSE, 118 FALSE,
119 G_PARAM_READABLE)); 119 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
120 120
121 g_object_class_install_property(gobject_class, PROP_CONTENTS, 121 g_object_class_install_property(gobject_class, PROP_CONTENTS,
122 g_param_spec_pointer("contents", 122 g_param_spec_pointer("contents",
123 "Contents", 123 "Contents",
124 "The active contents contained within this session", 124 "The active contents contained within this session",
125 G_PARAM_READABLE)); 125 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
126 126
127 g_object_class_install_property(gobject_class, PROP_PENDING_CONTENTS, 127 g_object_class_install_property(gobject_class, PROP_PENDING_CONTENTS,
128 g_param_spec_pointer("pending-contents", 128 g_param_spec_pointer("pending-contents",
129 "Pending contents", 129 "Pending contents",
130 "The pending contents contained within this session", 130 "The pending contents contained within this session",
131 G_PARAM_READABLE)); 131 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
132 132
133 g_type_class_add_private(klass, sizeof(JingleSessionPrivate)); 133 g_type_class_add_private(klass, sizeof(JingleSessionPrivate));
134 } 134 }
135 135
136 static void 136 static void
540 jingle_session_add_content(JingleSession *session, JingleContent* content) 540 jingle_session_add_content(JingleSession *session, JingleContent* content)
541 { 541 {
542 session->priv->contents = 542 session->priv->contents =
543 g_list_append(session->priv->contents, content); 543 g_list_append(session->priv->contents, content);
544 jingle_content_set_session(content, session); 544 jingle_content_set_session(content, session);
545
546 g_object_notify(G_OBJECT(session), "contents");
545 } 547 }
546 548
547 void 549 void
548 jingle_session_remove_content(JingleSession *session, const gchar *name, const gchar *creator) 550 jingle_session_remove_content(JingleSession *session, const gchar *name, const gchar *creator)
549 { 551 {
552 554
553 if (content) { 555 if (content) {
554 session->priv->contents = 556 session->priv->contents =
555 g_list_remove(session->priv->contents, content); 557 g_list_remove(session->priv->contents, content);
556 g_object_unref(content); 558 g_object_unref(content);
559
560 g_object_notify(G_OBJECT(session), "contents");
557 } 561 }
558 } 562 }
559 563
560 void 564 void
561 jingle_session_add_pending_content(JingleSession *session, JingleContent* content) 565 jingle_session_add_pending_content(JingleSession *session, JingleContent* content)
562 { 566 {
563 session->priv->pending_contents = 567 session->priv->pending_contents =
564 g_list_append(session->priv->pending_contents, content); 568 g_list_append(session->priv->pending_contents, content);
565 jingle_content_set_session(content, session); 569 jingle_content_set_session(content, session);
570
571 g_object_notify(G_OBJECT(session), "pending-contents");
566 } 572 }
567 573
568 void 574 void
569 jingle_session_remove_pending_content(JingleSession *session, const gchar *name, const gchar *creator) 575 jingle_session_remove_pending_content(JingleSession *session, const gchar *name, const gchar *creator)
570 { 576 {
572 578
573 if (content) { 579 if (content) {
574 session->priv->pending_contents = 580 session->priv->pending_contents =
575 g_list_remove(session->priv->pending_contents, content); 581 g_list_remove(session->priv->pending_contents, content);
576 g_object_unref(content); 582 g_object_unref(content);
583
584 g_object_notify(G_OBJECT(session), "pending-contents");
577 } 585 }
578 } 586 }
579 587
580 void 588 void
581 jingle_session_accept_content(JingleSession *session, const gchar *name, const gchar *creator) 589 jingle_session_accept_content(JingleSession *session, const gchar *name, const gchar *creator)
591 599
592 void 600 void
593 jingle_session_accept_session(JingleSession *session) 601 jingle_session_accept_session(JingleSession *session)
594 { 602 {
595 session->priv->state = TRUE; 603 session->priv->state = TRUE;
604
605 g_object_notify(G_OBJECT(session), "state");
596 } 606 }
597 607
598 JabberIq * 608 JabberIq *
599 jingle_session_terminate_packet(JingleSession *session, const gchar *reason) 609 jingle_session_terminate_packet(JingleSession *session, const gchar *reason)
600 { 610 {

mercurial