~singpolyma/cheogram-android

8fb2c11771d8e7a419682da7be8a38e5068c4460 — Daniel Gultsch 1 year, 5 months ago d51682a
use plurals for missed call strings
M src/main/java/eu/siacs/conversations/services/NotificationService.java => src/main/java/eu/siacs/conversations/services/NotificationService.java +25 -16
@@ 987,12 987,17 @@ public class NotificationService {
                (totalCalls == 1)
                        ? mXmppConnectionService.getString(R.string.missed_call)
                        : (mMissedCalls.size() == 1)
                                ? mXmppConnectionService.getString(
                                        R.string.n_missed_calls, totalCalls)
                                : mXmppConnectionService.getString(
                                        R.string.n_missed_calls_from_m_contacts,
                                        totalCalls,
                                        mMissedCalls.size());
                                ? mXmppConnectionService
                                        .getResources()
                                        .getQuantityString(
                                                R.plurals.n_missed_calls, totalCalls, totalCalls)
                                : mXmppConnectionService
                                        .getResources()
                                        .getQuantityString(
                                                R.plurals.n_missed_calls_from_m_contacts,
                                                mMissedCalls.size(),
                                                totalCalls,
                                                mMissedCalls.size());
        builder.setContentTitle(title);
        builder.setTicker(title);
        if (!publicVersion) {


@@ 1027,21 1032,25 @@ public class NotificationService {
        final String title =
                (info.getNumberOfCalls() == 1)
                        ? mXmppConnectionService.getString(R.string.missed_call)
                        : mXmppConnectionService.getString(
                                R.string.n_missed_calls, info.getNumberOfCalls());
                        : mXmppConnectionService
                                .getResources()
                                .getQuantityString(
                                        R.plurals.n_missed_calls,
                                        info.getNumberOfCalls(),
                                        info.getNumberOfCalls());
        builder.setContentTitle(title);
        final String name = conversation.getContact().getDisplayName();
        if (publicVersion) {
            builder.setTicker(title);
        } else {
            if (info.getNumberOfCalls() == 1) {
                builder.setTicker(
                        mXmppConnectionService.getString(R.string.missed_call_from_x, name));
            } else {
                builder.setTicker(
                        mXmppConnectionService.getString(
                                R.string.n_missed_calls_from_x, info.getNumberOfCalls(), name));
            }
            builder.setTicker(
                    mXmppConnectionService
                            .getResources()
                            .getQuantityString(
                                    R.plurals.n_missed_calls_from_x,
                                    info.getNumberOfCalls(),
                                    info.getNumberOfCalls(),
                                    name));
            builder.setContentText(name);
        }
        builder.setSmallIcon(R.drawable.ic_call_missed_white_24db);

M src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java => src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +1 -0
@@ 1291,6 1291,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
                SessionDescription.parse(webRTCSessionDescription.description);
        final RtpContentMap rtpContentMap = RtpContentMap.of(sessionDescription);
        this.initiatorRtpContentMap = rtpContentMap;
        //TODO delay ready to receive ice until after session-init
        this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true);
        final ListenableFuture<RtpContentMap> outgoingContentMapFuture =
                encryptSessionInitiate(rtpContentMap);

M src/main/res/values/strings.xml => src/main/res/values/strings.xml +12 -4
@@ 936,10 936,18 @@
    <string name="outgoing_call">Outgoing call</string>
    <string name="outgoing_call_duration">Outgoing call · %s</string>
    <string name="missed_call">Missed call</string>
    <string name="missed_call_from_x">Missed call from %s</string>
    <string name="n_missed_calls_from_x">%1$d missed calls from %2$s</string>
    <string name="n_missed_calls">%d missed calls</string>
    <string name="n_missed_calls_from_m_contacts">%1$d missed calls from %2$d contacts</string>
    <plurals name="n_missed_calls_from_x">
        <item quantity="one">%1$d missed call from %2$s</item>
        <item quantity="other">%1$d missed calls from %2$s</item>
    </plurals>
    <plurals name="n_missed_calls">
        <item quantity="one">%d missed call</item>
        <item quantity="other">%d missed calls</item>
    </plurals>
    <plurals name="n_missed_calls_from_m_contacts">
        <item quantity="one">%1$d missed calls from %2$d contact</item>
        <item quantity="other">%1$d missed calls from %2$d contacts</item>
    </plurals>
    <string name="audio_call">Audio call</string>
    <string name="video_call">Video call</string>
    <string name="help">Help</string>