Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
769e2b59
Kaydet (Commit)
769e2b59
authored
Agu 03, 2012
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tubes: stop collaborating when the account gets off-line
Change-Id: Ic6f1bc41bc212e0c36751168f1204c41ebe0ce61
üst
01839d6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
contact-list.cxx
tubes/source/contact-list.cxx
+12
-2
manager.cxx
tubes/source/manager.cxx
+26
-0
No files found.
tubes/source/contact-list.cxx
Dosyayı görüntüle @
769e2b59
...
...
@@ -71,9 +71,9 @@ ContactList::~ContactList()
mpAccountManager
=
NULL
;
}
bool
tb_
contact_is_online
(
TpContact
*
contact
)
bool
tb_
presence_is_online
(
const
TpConnectionPresenceType
&
presence
)
{
switch
(
tp_contact_get_presence_type
(
contact
)
)
switch
(
presence
)
{
case
TP_CONNECTION_PRESENCE_TYPE_UNSET
:
case
TP_CONNECTION_PRESENCE_TYPE_OFFLINE
:
...
...
@@ -91,6 +91,16 @@ bool tb_contact_is_online( TpContact *contact )
}
}
bool
tb_account_is_online
(
TpAccount
*
account
)
{
return
tb_presence_is_online
(
tp_account_get_current_presence
(
account
,
NULL
,
NULL
));
}
bool
tb_contact_is_online
(
TpContact
*
contact
)
{
return
tb_presence_is_online
(
tp_contact_get_presence_type
(
contact
));
}
namespace
tubes
{
void
reDrawAllContacts
();
}
...
...
tubes/source/manager.cxx
Dosyayı görüntüle @
769e2b59
...
...
@@ -105,8 +105,24 @@ public:
~
TeleManagerImpl
();
};
bool
tb_account_is_online
(
TpAccount
*
pAccount
);
bool
tb_contact_is_online
(
TpContact
*
pContact
);
static
void
account_presence_changed_cb
(
TpAccount
*
pAccount
,
guint
/* type */
,
gchar
*
/* status */
,
gchar
*
/* message */
,
gpointer
pConference
)
{
if
(
!
tb_account_is_online
(
pAccount
))
{
Collaboration
*
pCollaboration
=
reinterpret_cast
<
TeleConference
*>
(
pConference
)
->
getCollaboration
();
if
(
pCollaboration
)
pCollaboration
->
ContactLeft
();
}
}
static
void
contact_presence_changed_cb
(
TpContact
*
pContact
,
guint
/* type */
,
gchar
*
/* status */
,
...
...
@@ -157,6 +173,10 @@ void TeleManager_DBusChannelHandler(
TeleConference
*
pConference
=
new
TeleConference
(
pManager
,
pAccount
,
TP_DBUS_TUBE_CHANNEL
(
pChannel
)
);
pConference
->
acceptTube
();
pManager
->
addConference
(
pConference
);
g_signal_connect
(
pAccount
,
"presence-changed"
,
G_CALLBACK
(
account_presence_changed_cb
),
pConference
);
TpContact
*
pContact
=
tp_channel_get_target_contact
(
pChannel
);
if
(
pContact
)
g_signal_connect
(
pContact
,
"presence-changed"
,
...
...
@@ -636,6 +656,9 @@ TeleConference* TeleManager::startGroupSession( TpAccount *pAccount,
if
(
!
pConference
->
isReady
())
return
NULL
;
g_signal_connect
(
pAccount
,
"presence-changed"
,
G_CALLBACK
(
account_presence_changed_cb
),
pConference
);
return
pConference
;
}
...
...
@@ -711,6 +734,9 @@ TeleConference* TeleManager::startBuddySession( TpAccount *pAccount, TpContact *
if
(
!
pConference
->
isReady
())
return
NULL
;
g_signal_connect
(
pAccount
,
"presence-changed"
,
G_CALLBACK
(
account_presence_changed_cb
),
pConference
);
g_signal_connect
(
pBuddy
,
"presence-changed"
,
G_CALLBACK
(
contact_presence_changed_cb
),
pConference
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment