Skip to content

Commit

Permalink
Add invitation message.
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Oct 26, 2019
1 parent 13027e1 commit 5b4caca
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

buildscript {
/** THE VERSION NAME! */
ext.version_name = '0.1.0-alpha01'
ext.version_name = '0.1.0-alpha02'

ext.kotlin_version = '1.3.50'
ext.androidx_appcompat_version = '1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ class LocationSupportServiceImpl(
duration = duration
)

sendPacket(address, Packet.ofRequestingNewConnection(request))
// Add invitation message.
val explanation = context.getString(R.string.description_install_geomms)
sendPacket(address, Packet.ofRequestingNewConnection(request, explanation))

// Add this not-yet accepted connection to getRealm.
val temporalConnection = Connection.fromAcceptedRequest(request).apply { isTemporal = true }
Expand Down
3 changes: 3 additions & 0 deletions data/src/main/res/values-ko-rKR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@
<string name="notify_not_implemented">해당 기능은 아직 구현되지 않았습니다 :)</string>
<string name="fail_close_connection_not_expired">연결을 삭제할 수 없습니다. 아직 만료되지 않았습니다.</string>
<string name="fail_already_invited">%s님을 초대할 수 없습니다. 이미 초대되었습니다.</string>
<string name="fail_resend_not_sent_before">패킷 재전송에 실패했습니다. 이전에 패킷을 보낸 적이 없습니다.</string>
<string name="fail_resend_packet_no_connection">패킷 재전송에 실패했습니다. 연결이 유효하지 않습니다.</string>
<string name="description_install_geomms">GeoMms를 설치하고 친구와 위치를 공유해보세요!</string>
</resources>
1 change: 1 addition & 0 deletions data/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@
<string name="fail_already_invited">Cannot invite %s. Already invited or connected.</string>
<string name="fail_resend_packet_no_connection">Failed to resend packet. No valid connection found.</string>
<string name="fail_resend_not_sent_before">Failed to resend packet. No packet has been sent before.</string>
<string name="description_install_geomms">Install GeoMms and share your location with friends!</string>
</resources>
6 changes: 4 additions & 2 deletions domain/src/main/java/com/potados/geomms/model/Packet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class Packet(
) {

companion object {
fun ofRequestingNewConnection(request: ConnectionRequest) =
fun ofRequestingNewConnection(request: ConnectionRequest, explanation: String = "") =
Packet(
type = PacketType.REQUEST_CONNECT.number,
connectionId = request.connectionId,
duration = request.duration,
postFix = "\n${BuildConfig.STORE_LINK}"
postFix = "\n".takeIf { explanation.isNotEmpty() }
+ explanation + "\n"
+ BuildConfig.STORE_LINK
)

fun ofAcceptingRequest(request: ConnectionRequest) =
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true

storeLink="http://play.google.com/store/apps/details?id=com.potados.geomms"
storeLink="https://potados99.github.io/GeoMms-Start"

0 comments on commit 5b4caca

Please sign in to comment.