mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
swarm chat: make API visible and bump daemon version
Change-Id: Ice65f7ded98ef5575732334a9d6c61b81aeaf655
This commit is contained in:

committed by
Adrien Béraud

parent
26f4672670
commit
1527828d79
78
bin/nodejs/conversation.i
Normal file
78
bin/nodejs/conversation.i
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2021 Savoir-faire Linux Inc.
|
||||
*
|
||||
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
%header %{
|
||||
#include "dring/dring.h"
|
||||
#include "dring/conversation_interface.h"
|
||||
|
||||
class ConversationCallback {
|
||||
public:
|
||||
virtual ~ConversationCallback(){}
|
||||
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector<std::map<std::string, std::string>> /*messages*/){}
|
||||
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map<std::string, std::string> /*message*/){}
|
||||
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map<std::string, std::string> /*metadatas*/){}
|
||||
virtual void conversationReady(const std::string& /*accountId*/, const std::string& /* conversationId */){}
|
||||
};
|
||||
%}
|
||||
|
||||
%feature("director") ConversationCallback;
|
||||
|
||||
namespace DRing {
|
||||
|
||||
struct DataTransferInfo
|
||||
{
|
||||
std::string accountId;
|
||||
DRing::DataTransferEventCode lastEvent;
|
||||
uint32_t flags;
|
||||
int64_t totalSize;
|
||||
int64_t bytesProgress;
|
||||
std::string peer;
|
||||
std::string displayName;
|
||||
std::string path;
|
||||
std::string mimetype;
|
||||
};
|
||||
|
||||
// Conversation management
|
||||
std::string startConversation(const std::string& accountId);
|
||||
void acceptConversationRequest(const std::string& accountId, const std::string& conversationId);
|
||||
void declineConversationRequest(const std::string& accountId, const std::string& conversationId);
|
||||
bool removeConversation(const std::string& accountId, const std::string& conversationId);
|
||||
std::vector<std::string> getConversations(const std::string& accountId);
|
||||
std::vector<std::map<std::string, std::string>> getConversationRequests(const std::string& accountId);
|
||||
|
||||
// Member management
|
||||
bool addConversationMember(const std::string& accountId, const std::string& conversationId, const std::string& contactUri);
|
||||
bool removeConversationMember(const std::string& accountId, const std::string& conversationId, const std::string& contactUri);
|
||||
std::vector<std::map<std::string, std::string>> getConversationMembers(const std::string& accountId, const std::string& conversationId);
|
||||
|
||||
// Message send/load
|
||||
void sendMessage(const std::string& accountId, const std::string& conversationId, const std::string& message, const std::string& parent);
|
||||
uint32_t loadConversationMessages(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
|
||||
|
||||
}
|
||||
|
||||
class ConversationCallback {
|
||||
public:
|
||||
virtual ~ConversationCallback(){}
|
||||
virtual void conversationLoaded(uint32_t /* id */, const std::string& /*accountId*/, const std::string& /* conversationId */, std::vector<std::map<std::string, std::string>> /*messages*/){}
|
||||
virtual void messageReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map<std::string, std::string> /*message*/){}
|
||||
virtual void conversationRequestReceived(const std::string& /*accountId*/, const std::string& /* conversationId */, std::map<std::string, std::string> /*metadatas*/){}
|
||||
virtual void conversationReady(const std::string& /*accountId*/, const std::string& /* conversationId */){}
|
||||
};
|
Reference in New Issue
Block a user