forked from mirror/monocles_chat
show user account in call notification
This commit is contained in:
parent
04268bb604
commit
2ed297f722
3 changed files with 31 additions and 1 deletions
|
@ -363,7 +363,13 @@ public class NotificationService {
|
|||
if (systemAccount != null) {
|
||||
builder.addPerson(systemAccount.toString());
|
||||
}
|
||||
builder.setContentText(id.account.getRoster().getContact(id.with).getDisplayName());
|
||||
String string = id.account.getRoster().getContact(id.with).getDisplayName();
|
||||
if (mXmppConnectionService.multipleAccounts()) {
|
||||
string += " (";
|
||||
string += id.account.getJid().asBareJid().toString();
|
||||
string += ")";
|
||||
}
|
||||
builder.setContentText(string);
|
||||
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||
builder.setPriority(NotificationCompat.PRIORITY_HIGH);
|
||||
builder.setCategory(NotificationCompat.CATEGORY_CALL);
|
||||
|
|
|
@ -271,6 +271,18 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
final Account account = extractAccount(intent);
|
||||
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
|
||||
final String sessionId = intent.getStringExtra(EXTRA_SESSION_ID);
|
||||
String accountname;
|
||||
if (Config.DOMAIN_LOCK != null) {
|
||||
accountname = account.getJid().getLocal();
|
||||
} else {
|
||||
accountname = account.getJid().asBareJid().toString();
|
||||
}
|
||||
binding.detailsAccount.setText(getString(R.string.using_account, accountname));
|
||||
if (xmppConnectionService.multipleAccounts()) {
|
||||
binding.detailsAccount.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
binding.detailsAccount.setVisibility(View.GONE);
|
||||
}
|
||||
if (sessionId != null) {
|
||||
if (initializeActivityWithRunningRtpSession(account, with, sessionId)) {
|
||||
return;
|
||||
|
|
|
@ -84,6 +84,18 @@
|
|||
android:layout_centerInParent="true"
|
||||
app:riv_corner_radius="@dimen/incoming_call_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/details_account"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="bottom"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/using_account"
|
||||
android:textAppearance="@style/TextAppearance.Conversations.Caption" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue