Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
09866072
Commit
09866072
authored
Nov 10, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ChatRoom): add a chat room identifier object
parent
e43d58fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
0 deletions
+116
-0
CMakeLists.txt
src/CMakeLists.txt
+2
-0
chat-room-id.cpp
src/chat/chat-room/chat-room-id.cpp
+67
-0
chat-room-id.h
src/chat/chat-room/chat-room-id.h
+47
-0
No files found.
src/CMakeLists.txt
View file @
09866072
...
...
@@ -35,6 +35,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
chat/chat-message/chat-message.h
chat/chat-room/basic-chat-room-p.h
chat/chat-room/basic-chat-room.h
chat/chat-room/chat-room-id.h
chat/chat-room/chat-room-p.h
chat/chat-room/chat-room.h
chat/chat-room/client-group-chat-room-p.h
...
...
@@ -159,6 +160,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
call/call.cpp
chat/chat-message/chat-message.cpp
chat/chat-room/basic-chat-room.cpp
chat/chat-room/chat-room-id.cpp
chat/chat-room/chat-room.cpp
chat/chat-room/client-group-chat-room.cpp
chat/chat-room/real-time-text-chat-room.cpp
...
...
src/chat/chat-room/chat-room-id.cpp
0 → 100644
View file @
09866072
/*
* chat-room-id.cpp
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* 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 2
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "object/clonable-object-p.h"
#include "chat-room-id.h"
// =============================================================================
using
namespace
std
;
LINPHONE_BEGIN_NAMESPACE
class
ChatRoomIdPrivate
:
public
ClonableObjectPrivate
{
public
:
SimpleAddress
peerAddress
;
SimpleAddress
localAddress
;
};
// -----------------------------------------------------------------------------
ChatRoomId
::
ChatRoomId
(
const
SimpleAddress
&
peerAddress
,
const
SimpleAddress
&
localAddress
)
:
ClonableObject
(
*
new
ChatRoomIdPrivate
)
{
L_D
();
d
->
peerAddress
=
peerAddress
;
d
->
localAddress
=
localAddress
;
}
bool
ChatRoomId
::
operator
==
(
const
ChatRoomId
&
chatRoomId
)
const
{
L_D
();
const
ChatRoomIdPrivate
*
dChatRoomId
=
chatRoomId
.
getPrivate
();
return
d
->
peerAddress
==
dChatRoomId
->
peerAddress
&&
d
->
localAddress
==
dChatRoomId
->
localAddress
;
}
bool
ChatRoomId
::
operator
!=
(
const
ChatRoomId
&
chatRoomId
)
const
{
return
!
(
*
this
==
chatRoomId
);
}
const
SimpleAddress
&
ChatRoomId
::
getPeerAddress
()
const
{
L_D
();
return
d
->
peerAddress
;
}
const
SimpleAddress
&
ChatRoomId
::
getLocalAddress
()
const
{
L_D
();
return
d
->
localAddress
;
}
LINPHONE_END_NAMESPACE
src/chat/chat-room/chat-room-id.h
0 → 100644
View file @
09866072
/*
* chat-room-id.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* 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 2
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _CHAT_ROOM_ID_H_
#define _CHAT_ROOM_ID_H_
#include "address/simple-address.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class
ChatRoomIdPrivate
;
class
LINPHONE_PUBLIC
ChatRoomId
:
public
ClonableObject
{
public
:
ChatRoomId
(
const
SimpleAddress
&
peerAddress
,
const
SimpleAddress
&
localAddress
);
bool
operator
==
(
const
ChatRoomId
&
chatRoomId
)
const
;
bool
operator
!=
(
const
ChatRoomId
&
chatRoomId
)
const
;
const
SimpleAddress
&
getPeerAddress
()
const
;
const
SimpleAddress
&
getLocalAddress
()
const
;
private
:
L_DECLARE_PRIVATE
(
ChatRoomId
);
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CHAT_ROOM_ID_H_
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