Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-uwp
Commits
8f805cd5
Commit
8f805cd5
authored
Oct 05, 2016
by
Nicolas Jager
Browse files
message text : screen messages sent during a call
Change-Id: Ifb7d8ed39d4cd6359ead1e5ff365fd700e604527 Tuleap: #1209
parent
11e7bafa
Changes
8
Hide whitespace changes
Inline
Side-by-side
ContactsViewModel.cpp
View file @
8f805cd5
...
@@ -66,6 +66,7 @@ ContactsViewModel::ContactsViewModel()
...
@@ -66,6 +66,7 @@ ContactsViewModel::ContactsViewModel()
saveContactsToFile
();
saveContactsToFile
();
}
}
});
});
RingD
::
instance
->
incomingMessage
+=
ref
new
RingClientUWP
::
IncomingMessage
(
this
,
&
RingClientUWP
::
ViewModel
::
ContactsViewModel
::
OnincomingMessage
);
}
}
Contact
^
// refacto : remove "byName"
Contact
^
// refacto : remove "byName"
...
@@ -167,3 +168,27 @@ ContactsViewModel::Destringify(String^ data)
...
@@ -167,3 +168,27 @@ ContactsViewModel::Destringify(String^ data)
}
}
}
}
}
}
void
RingClientUWP
::
ViewModel
::
ContactsViewModel
::
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
)
{
auto
contact
=
findContactByName
(
from
);
/* the contact HAS TO BE already registered */
if
(
contact
)
{
auto
item
=
SmartPanelItemsViewModel
::
instance
->
_selectedItem
;
contact
->
_conversation
->
addMessage
(
""
/* date not yet used*/
,
MSG_FROM_CONTACT
,
payload
);
/* save contacts conversation to disk */
contact
->
saveConversationToFile
();
auto
selectedContact
=
(
item
)
?
item
->
_contact
:
nullptr
;
if
(
contact
->
ringID_
==
from
&&
contact
!=
selectedContact
)
{
contact
->
_unreadMessages
++
;
/* saveContactsToFile used to save the notification */
saveContactsToFile
();
}
}
}
ContactsViewModel.h
View file @
8f805cd5
...
@@ -68,6 +68,7 @@ private:
...
@@ -68,6 +68,7 @@ private:
Contact
^
currentItem_
;
Contact
^
currentItem_
;
Contact
^
oldItem_
;
Contact
^
oldItem_
;
void
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
);
};
};
}
}
}
}
MessageTextPage.xaml.cpp
View file @
8f805cd5
...
@@ -49,6 +49,8 @@ MessageTextPage::MessageTextPage()
...
@@ -49,6 +49,8 @@ MessageTextPage::MessageTextPage()
String
^
fromRingId
,
String
^
payload
)
{
String
^
fromRingId
,
String
^
payload
)
{
scrollDown
();
scrollDown
();
});
});
RingD
::
instance
->
incomingMessage
+=
ref
new
RingClientUWP
::
IncomingMessage
(
this
,
&
RingClientUWP
::
Views
::
MessageTextPage
::
OnincomingMessage
);
}
}
void
void
...
@@ -135,3 +137,9 @@ Object ^ RingClientUWP::Views::BubbleHorizontalAlignement::ConvertBack(Object ^
...
@@ -135,3 +137,9 @@ Object ^ RingClientUWP::Views::BubbleHorizontalAlignement::ConvertBack(Object ^
RingClientUWP
::
Views
::
BubbleHorizontalAlignement
::
BubbleHorizontalAlignement
()
RingClientUWP
::
Views
::
BubbleHorizontalAlignement
::
BubbleHorizontalAlignement
()
{}
{}
void
RingClientUWP
::
Views
::
MessageTextPage
::
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
)
{
scrollDown
();
}
MessageTextPage.xaml.h
View file @
8f805cd5
...
@@ -49,6 +49,7 @@ private:
...
@@ -49,6 +49,7 @@ private:
void
_sendBtn__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_sendBtn__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_messageTextBox__KeyDown
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
KeyRoutedEventArgs
^
e
);
void
_messageTextBox__KeyDown
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
KeyRoutedEventArgs
^
e
);
void
sendMessage
();
void
sendMessage
();
void
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
);
};
};
}
}
}
}
RingD.cpp
View file @
8f805cd5
...
@@ -235,7 +235,6 @@ RingClientUWP::RingD::startDaemon()
...
@@ -235,7 +235,6 @@ RingClientUWP::RingD::startDaemon()
auto
contact
=
ContactsViewModel
::
instance
->
findContactByName
(
from2
);
auto
contact
=
ContactsViewModel
::
instance
->
findContactByName
(
from2
);
auto
item
=
SmartPanelItemsViewModel
::
instance
->
findItem
(
contact
);
auto
item
=
SmartPanelItemsViewModel
::
instance
->
findItem
(
contact
);
item
->
_callId
=
callId2
;
item
->
_callId
=
callId2
;
}));
}));
}),
}),
DRing
::
exportable_callback
<
DRing
::
CallSignal
::
StateChange
>
([
this
](
DRing
::
exportable_callback
<
DRing
::
CallSignal
::
StateChange
>
([
this
](
...
@@ -315,8 +314,7 @@ RingClientUWP::RingD::startDaemon()
...
@@ -315,8 +314,7 @@ RingClientUWP::RingD::startDaemon()
CoreApplication
::
MainView
->
CoreWindow
->
Dispatcher
->
RunAsync
(
CoreApplication
::
MainView
->
CoreWindow
->
Dispatcher
->
RunAsync
(
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
{
// DOIT ETRE DIFFEREND.... NE PAS UTILISE accoutId2
incomingMessage
(
callId2
,
from2
,
payload
);
//incomingAccountMessage(accountId2, from2, payload);
MSG_
(
"message recu :"
+
i
.
second
);
MSG_
(
"message recu :"
+
i
.
second
);
}));
}));
}
}
...
...
RingD.h
View file @
8f805cd5
...
@@ -31,6 +31,7 @@ delegate void IncomingCall(String^ accountId, String^ callId, String^ from);
...
@@ -31,6 +31,7 @@ delegate void IncomingCall(String^ accountId, String^ callId, String^ from);
delegate
void
StateChange
(
String
^
callId
,
CallStatus
state
,
int
code
);
delegate
void
StateChange
(
String
^
callId
,
CallStatus
state
,
int
code
);
delegate
void
IncomingAccountMessage
(
String
^
accountId
,
String
^
from
,
String
^
payload
);
delegate
void
IncomingAccountMessage
(
String
^
accountId
,
String
^
from
,
String
^
payload
);
delegate
void
CallPlaced
(
String
^
callId
);
delegate
void
CallPlaced
(
String
^
callId
);
delegate
void
IncomingMessage
(
String
^
callId
,
String
^
from
,
String
^
payload
);
public
ref
class
RingD
sealed
public
ref
class
RingD
sealed
...
@@ -95,6 +96,7 @@ internal:
...
@@ -95,6 +96,7 @@ internal:
event
IncomingCall
^
incomingCall
;
event
IncomingCall
^
incomingCall
;
event
StateChange
^
stateChange
;
event
StateChange
^
stateChange
;
event
IncomingAccountMessage
^
incomingAccountMessage
;
event
IncomingAccountMessage
^
incomingAccountMessage
;
event
IncomingMessage
^
incomingMessage
;
event
CallPlaced
^
callPlaced
;
event
CallPlaced
^
callPlaced
;
private:
private:
...
...
VideoPage.xaml.cpp
View file @
8f805cd5
...
@@ -125,10 +125,7 @@ VideoPage::VideoPage()
...
@@ -125,10 +125,7 @@ VideoPage::VideoPage()
}
}
});
});
RingD
::
instance
->
incomingAccountMessage
+=
ref
new
IncomingAccountMessage
([
&
](
String
^
accountId
,
RingD
::
instance
->
incomingMessage
+=
ref
new
RingClientUWP
::
IncomingMessage
(
this
,
&
RingClientUWP
::
Views
::
VideoPage
::
OnincomingMessage
);
String
^
from
,
String
^
payload
)
{
scrollDown
();
});
}
}
void
void
...
@@ -333,3 +330,9 @@ VideoPage::WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width,
...
@@ -333,3 +330,9 @@ VideoPage::WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width,
}
}
});
});
}
}
void
RingClientUWP
::
Views
::
VideoPage
::
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
)
{
scrollDown
();
}
VideoPage.xaml.h
View file @
8f805cd5
...
@@ -115,6 +115,7 @@ private:
...
@@ -115,6 +115,7 @@ private:
void
_videoControl__PointerMoved
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
_videoControl__PointerMoved
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
btnAny_entered
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
btnAny_entered
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
btnAny_exited
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
btnAny_exited
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
PointerRoutedEventArgs
^
e
);
void
OnincomingMessage
(
Platform
::
String
^
callId
,
Platform
::
String
^
from
,
Platform
::
String
^
payload
);
};
};
}
}
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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