Ring Daemon 16.0.0
Loading...
Searching...
No Matches
presencemanager_interface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef LIBJAMI_PRESENCEMANAGERI_H
19#define LIBJAMI_PRESENCEMANAGERI_H
20
21#include "def.h"
22
23#include <vector>
24#include <map>
25#include <string>
26#include <memory>
27
28#include "jami.h"
29#include "presence_const.h"
30
31namespace libjami {
32
33[[deprecated("Replaced by registerSignalHandlers")]] LIBJAMI_PUBLIC void registerPresHandlers(
34 const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
35
36/* Presence subscription/Notification. */
37LIBJAMI_PUBLIC void publish(const std::string& accountID, bool status, const std::string& note);
38LIBJAMI_PUBLIC void answerServerRequest(const std::string& uri, bool flag);
39LIBJAMI_PUBLIC void subscribeBuddy(const std::string& accountID, const std::string& uri, bool flag);
40LIBJAMI_PUBLIC std::vector<std::map<std::string, std::string>> getSubscriptions(
41 const std::string& accountID);
42LIBJAMI_PUBLIC void setSubscriptions(const std::string& accountID,
43 const std::vector<std::string>& uris);
44
45// Presence signal type definitions
47{
49 {
50 constexpr static const char* name = "NewServerSubscriptionRequest";
51 using cb_type = void(const std::string& /*remote*/);
52 };
54 {
55 constexpr static const char* name = "ServerError";
56 using cb_type = void(const std::string& /*account_id*/,
57 const std::string& /*error*/,
58 const std::string& /*msg*/);
59 };
61 {
62 constexpr static const char* name = "NewBuddyNotification";
63 using cb_type = void(const std::string& /*account_id*/,
64 const std::string& /*buddy_uri*/,
65 int /*status*/,
66 const std::string& /*line_status*/);
67 };
69 {
70 constexpr static const char* name = "NearbyPeerNotification";
71 using cb_type = void(const std::string& /*account_id*/,
72 const std::string& /*buddy_uri*/,
73 int /*state*/,
74 const std::string& /*displayname*/);
75 };
77 {
78 constexpr static const char* name = "SubscriptionStateChanged";
79 using cb_type = void(const std::string& /*account_id*/,
80 const std::string& /*buddy_uri*/,
81 int /*state*/);
82 };
83};
84
85} // namespace libjami
86
87#endif // PRESENCEMANAGERI_H
#define LIBJAMI_PUBLIC
Definition def.h:42
std::vector< std::map< std::string, std::string > > getSubscriptions(const std::string &accountId)
Get all active subscriptions for "accountId".
void subscribeBuddy(const std::string &accountId, const std::string &uri, bool flag)
Un/subscribe to buddySipUri for an accountId.
void registerPresHandlers(const std::map< std::string, std::shared_ptr< CallbackWrapperBase > > &handlers)
void answerServerRequest(UNUSED const std::string &uri, UNUSED bool flag)
Accept or not a PresSubServer request for IP2IP account.
void setSubscriptions(const std::string &accountId, const std::vector< std::string > &uris)
Batch subscribing of URIs.
void publish(const std::string &accountId, bool status, const std::string &note)
push a presence for a account Notify for IP2IP account For JamiAccount status is ignored but note is ...
void(const std::string &, const std::string &, int, const std::string &) cb_type
void(const std::string &, const std::string &, int, const std::string &) cb_type
void(const std::string &, const std::string &, const std::string &) cb_type
void(const std::string &, const std::string &, int) cb_type