Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions shared/src/commonMain/composeResources/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Für den Quellcode und weitere technische Details besuchen Sie das GitHub-Reposi
<string name="info_link_about_app">Über die App</string>
<string name="info_link_partners">Unsere Partner</string>
<string name="info_link_code_of_conduct">Verhaltenskodex</string>
<string name="info_link_news_feed">Newsfeed</string>
<string name="info_link_settings">Einstellungen</string>
<string name="info_link_description_twitter">Twitter</string>
<string name="info_link_description_slack">Slack</string>
Expand Down Expand Up @@ -79,10 +78,6 @@ Wir verarbeiten Ihre Daten gemäß dem Datenschutzhinweis der App. Sie können I
<string name="notifications_session_reminders_description">Erhalten Sie Erinnerungen für Sitzungen, die Sie im Zeitplan mit einem Lesezeichen versehen haben, damit Sie sie nicht verpassen.</string>
<string name="notifications_schedule_update_title">Zeitplan-Updates</string>
<string name="notifications_schedule_update_description">Bleiben Sie über wichtige Änderungen informiert! Erhalten Sie eine Benachrichtigung, wenn es eine bedeutende Aktualisierung des Veranstaltungszeitplans gibt.</string>
<string name="notifications_kotlinconf_news_title">KotlinConf-Neuigkeiten</string>
<string name="notifications_kotlinconf_news_description">Erhalten Sie Neuigkeiten zwischen KotlinConf-Veranstaltungen, einschließlich Benachrichtigungen über Ticketverkäufe, neue Videos, Wettbewerbe, Zeitplanankündigungen und mehr.</string>
<string name="notifications_jetbrains_news_title">JetBrains-Neuigkeiten</string>
<string name="notifications_jetbrains_news_description">Erhalten Sie Neuigkeiten über JetBrains-Produkte.</string>
<string name="notifications_lets_get_started">Lass uns anfangen!</string>

<string name="code_of_conduct">Verhaltenskodex</string>
Expand Down Expand Up @@ -135,9 +130,6 @@ Wir verarbeiten Ihre Daten gemäß dem Datenschutzhinweis der App. Sie können I
<string name="map_ground_floor">Erdgeschoss</string>
<string name="map_first_floor">Erster Stock</string>

<string name="news_feed_title">Neuigkeiten</string>
<string name="news_feed_empty">Keine Neuigkeiten... ist das eine gute Nachricht?</string>

<string name="speakers_title">Sprecher</string>
<string name="speakers_error_no_results">Keine Ergebnisse</string>
<string name="speakers_error_no_data">Unsere Sprecher spielen Verstecken. Geben Sie uns einen Moment, um sie zu finden!</string>
Expand Down
8 changes: 0 additions & 8 deletions shared/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ For the source code and more technical details, visit the GitHub repository.</st
<string name="info_link_about_app">About the app</string>
<string name="info_link_partners">Our partners</string>
<string name="info_link_code_of_conduct">Code of conduct</string>
<string name="info_link_news_feed">News feed</string>
<string name="info_link_settings">Settings</string>
<string name="info_link_description_twitter">Twitter</string>
<string name="info_link_description_slack">Slack</string>
Expand Down Expand Up @@ -79,10 +78,6 @@ We will process your data in accordance with the App Privacy Notice. You can adj
<string name="notifications_session_reminders_description">Get reminders for sessions that you’ve bookmarked in the schedule to make sure you don’t miss them.</string>
<string name="notifications_schedule_update_title">Schedule updates</string>
<string name="notifications_schedule_update_description">Stay informed about crucial changes! Get an alert if there's a significant update to the event schedule.</string>
<string name="notifications_kotlinconf_news_title">KotlinConf News</string>
<string name="notifications_kotlinconf_news_description">Receive news in between KotlinConf events, including notifications about ticket sales, new videos, contests, schedule announcements, and more.</string>
<string name="notifications_jetbrains_news_title">JetBrains News</string>
<string name="notifications_jetbrains_news_description">Get news about JetBrains products.</string>
<string name="notifications_lets_get_started">Let’s get started!</string>

<string name="code_of_conduct">Code of Conduct</string>
Expand Down Expand Up @@ -135,9 +130,6 @@ We will process your data in accordance with the App Privacy Notice. You can adj
<string name="map_ground_floor">Ground floor</string>
<string name="map_first_floor">First floor</string>

<string name="news_feed_title">News</string>
<string name="news_feed_empty">No news… is good news?</string>

<string name="speakers_title">Speakers</string>
<string name="speakers_error_no_results">No results</string>
<string name="speakers_error_no_data">Our speakers are playing hide and seek. Give us a moment to find them!</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ class APIClient(
}
}

suspend fun getNews(): List<NewsItem>? {
return safeApiCall { client.get("news").body<NewsListResponse>().items }
}

/**
* Runs the [call], returning its result or `null` if exceptions occurred.
Expand Down
22 changes: 5 additions & 17 deletions shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/AppInit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfig
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import org.jetbrains.kotlinconf.navigation.navigateToNews
import org.jetbrains.kotlinconf.navigation.navigateToSession
import org.jetbrains.kotlinconf.screens.AboutConferenceViewModel
import org.jetbrains.kotlinconf.screens.LicensesViewModel
import org.jetbrains.kotlinconf.screens.NewsDetailViewModel
import org.jetbrains.kotlinconf.screens.NewsListViewModel
import org.jetbrains.kotlinconf.screens.PrivacyNoticeViewModel
import org.jetbrains.kotlinconf.screens.ScheduleViewModel
import org.jetbrains.kotlinconf.screens.SessionViewModel
Expand Down Expand Up @@ -81,8 +78,6 @@ private fun initKoin(
val viewModelModule = module {
viewModelOf(::AboutConferenceViewModel)
viewModelOf(::LicensesViewModel)
viewModelOf(::NewsDetailViewModel)
viewModelOf(::NewsListViewModel)
viewModelOf(::PrivacyNoticeViewModel)
viewModelOf(::ScheduleViewModel)
viewModelOf(::SessionViewModel)
Expand All @@ -104,31 +99,24 @@ private fun initNotifier(
) {
NotifierManager.initialize(configuration)
NotifierManager.addListener(object : Listener {
var taggedLogger: TaggedLogger? = logger.tagged("KMPNotifier")
var taggedLogger: TaggedLogger = logger.tagged("KMPNotifier")

override fun onNotificationClicked(data: PayloadData) {
super.onNotificationClicked(data)
taggedLogger?.log { "Notification clicked with $data" }

val newsId = data[PushNotificationConstants.KEY_NEWS_ID] as? String
if (newsId != null) {
taggedLogger?.log { "Navigating to news: $newsId" }
navigateToNews(newsId)
return
}
taggedLogger.log { "Notification clicked with $data" }

val sessionId = data[PushNotificationConstants.KEY_SESSION_ID] as? String
if (sessionId != null) {
taggedLogger?.log { "Navigating to session: $sessionId" }
taggedLogger.log { "Navigating to session: $sessionId" }
navigateToSession(SessionId(sessionId))
return
}

taggedLogger?.log { "No data to navigate with, ignoring notification" }
taggedLogger.log { "No data to navigate with, ignoring notification" }
}

override fun onNewToken(token: String) {
taggedLogger?.log { "New token received: $token" }
taggedLogger.log { "New token received: $token" }
}
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ class ConferenceService(
// Download fresh conference data
loadConferenceData()

// Load fresh news items
loadNews()

// Wait for user ID to be loaded
userIdLoaded.await()

Expand All @@ -76,8 +73,6 @@ class ConferenceService(
val notifier = NotifierManager.getPushNotifier()
listOf(
settings.scheduleUpdates to PushNotificationConstants.TOPIC_SCHEDULE_UPDATES,
settings.kotlinConfNews to PushNotificationConstants.TOPIC_KOTLINCONF_NEWS,
settings.jetBrainsNews to PushNotificationConstants.TOPIC_JETBRAINS_NEWS,
).forEach { (enabled, topic) ->
if (enabled) notifier.subscribeToTopic(topic)
else notifier.unSubscribeFromTopic(topic)
Expand All @@ -86,12 +81,6 @@ class ConferenceService(
}
}

val news: Flow<List<NewsDisplayItem>> = storage.getNews()
.map { newsItems ->
val now = timeProvider.now()
newsItems.map { newsItem -> mapNewsItemToDisplayItem(newsItem, now) }
}
.flowOn(Dispatchers.Default)

val agenda: StateFlow<List<Day>> =
combine(
Expand Down Expand Up @@ -235,8 +224,6 @@ class ConferenceService(
it ?: NotificationSettings(
sessionReminders = true,
scheduleUpdates = true,
kotlinConfNews = true,
jetBrainsNews = true,
)
}

Expand Down Expand Up @@ -284,10 +271,6 @@ class ConferenceService(
fun sessionsForSpeakerFlow(id: SpeakerId): Flow<List<SessionCardView>> =
sessionCards.map { sessions -> sessions.filter { id in it.speakerIds } }

fun newsById(newsId: String): Flow<NewsDisplayItem?> =
news.map { allNews ->
allNews.find { it.id == newsId }
}

fun setFavorite(sessionId: SessionId, favorite: Boolean) {
scope.launch {
Expand Down Expand Up @@ -362,32 +345,6 @@ class ConferenceService(
localNotificationService.cancel(LocalNotificationId(Type.SessionEnd, sessionId.id))
}

private fun mapNewsItemToDisplayItem(
item: NewsItem,
now: LocalDateTime,
): NewsDisplayItem {
return NewsDisplayItem(
id = item.id,
photoUrl = item.photoUrl,
date = item.publicationDate.toNewsDisplayTime(now),
title = item.title,
content = item.content,
)
}

private fun LocalDateTime.toNewsDisplayTime(now: LocalDateTime): String {
val isToday = year == now.year && dayOfYear == now.dayOfYear
return when {
isToday -> DateTimeFormatting.time(this)
year == now.year -> DateTimeFormatting.date(this)
else -> DateTimeFormatting.dateWithYear(this)
}
}

suspend fun loadNews() {
val news = client.getNews() ?: return
storage.setNews(news)
}

private suspend fun syncVotes() {
if (!checkUserId()) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ data class NewsListResponse(
data class NotificationSettings(
val sessionReminders: Boolean,
val scheduleUpdates: Boolean,
val kotlinConfNews: Boolean,
val jetBrainsNews: Boolean,
) {
fun hasAnyEnabled() = sessionReminders || scheduleUpdates || kotlinConfNews || jetBrainsNews
fun hasAnyEnabled() = sessionReminders || scheduleUpdates
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package org.jetbrains.kotlinconf

object PushNotificationConstants {
const val TOPIC_JETBRAINS_NEWS = "JetBrainsNews"
const val TOPIC_KOTLINCONF_NEWS = "KotlinConfNews"
const val TOPIC_SCHEDULE_UPDATES = "ScheduleUpdates"

const val KEY_NEWS_ID = "newsId"
const val KEY_SESSION_ID = "sessionId"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import org.jetbrains.kotlinconf.screens.DeveloperMenuScreen
import org.jetbrains.kotlinconf.screens.LicensesScreen
import org.jetbrains.kotlinconf.screens.MainScreen
import org.jetbrains.kotlinconf.screens.NestedMapScreen
import org.jetbrains.kotlinconf.screens.NewsDetailScreen
import org.jetbrains.kotlinconf.screens.NewsListScreen
import org.jetbrains.kotlinconf.screens.PartnerDetailScreen
import org.jetbrains.kotlinconf.screens.PartnersScreen
import org.jetbrains.kotlinconf.screens.VisitorPrivacyNotice
Expand Down Expand Up @@ -61,10 +59,6 @@ fun navigateToSession(sessionId: SessionId) {
notificationNavRequests.trySend(SessionScreen(sessionId))
}

fun navigateToNews(newsId: String) {
notificationNavRequests.trySend(NewsDetailScreen(newsId = newsId))
}

private val notificationNavRequests = Channel<Any>(capacity = 1)

@Composable
Expand Down Expand Up @@ -236,17 +230,6 @@ fun NavGraphBuilder.screens(navController: NavHostController) {
)
}

composable<NewsListScreen> {
NewsListScreen(
onNewsClick = { newsId -> navController.navigate(NewsDetailScreen(newsId)) },
onBack = navController::navigateUp,
)
}
composable<NewsDetailScreen> {
val newsId = it.toRoute<NewsDetailScreen>().newsId
NewsDetailScreen(newsId, onBack = navController::navigateUp)
}

composable<DeveloperMenuScreen> {
DeveloperMenuScreen(onBack = navController::navigateUp)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ data object MapScreen
@SerialName("MapDetail")
data class NestedMapScreen(val roomName: String)

@Serializable
@SerialName("News")
data object NewsListScreen

@Serializable
@SerialName("News")
data class NewsDetailScreen(val newsId: String)

@Serializable
@SerialName("DeveloperMenu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import kotlinconfapp.shared.generated.resources.info_link_code_of_conduct
import kotlinconfapp.shared.generated.resources.info_link_description_bluesky
import kotlinconfapp.shared.generated.resources.info_link_description_slack
import kotlinconfapp.shared.generated.resources.info_link_description_twitter
import kotlinconfapp.shared.generated.resources.info_link_news_feed
import kotlinconfapp.shared.generated.resources.info_link_partners
import kotlinconfapp.shared.generated.resources.info_title
import kotlinconfapp.shared.generated.resources.kotlinconf_by_jetbrains
Expand All @@ -47,7 +46,6 @@ import org.jetbrains.kotlinconf.ui.theme.KotlinConfTheme
fun InfoScreen(
onAboutConf: () -> Unit,
onAboutApp: () -> Unit,
onNewsFeed: () -> Unit,
onOurPartners: () -> Unit,
onCodeOfConduct: () -> Unit,
onTwitter: () -> Unit,
Expand Down Expand Up @@ -77,7 +75,6 @@ fun InfoScreen(
PageMenuItem(stringResource(Res.string.info_link_about_conf), onClick = onAboutConf)
PageMenuItem(stringResource(Res.string.info_link_about_app), onClick = onAboutApp)
PageMenuItem(stringResource(Res.string.info_link_settings), onClick = onSettings)
PageMenuItem(stringResource(Res.string.info_link_news_feed), onClick = onNewsFeed)
PageMenuItem(stringResource(Res.string.info_link_partners), onClick = onOurPartners)
PageMenuItem(stringResource(Res.string.info_link_code_of_conduct), onClick = onCodeOfConduct)
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import org.jetbrains.kotlinconf.navigation.AboutConferenceScreen
import org.jetbrains.kotlinconf.navigation.CodeOfConductScreen
import org.jetbrains.kotlinconf.navigation.InfoScreen
import org.jetbrains.kotlinconf.navigation.MapScreen
import org.jetbrains.kotlinconf.navigation.NewsListScreen
import org.jetbrains.kotlinconf.navigation.PartnersScreen
import org.jetbrains.kotlinconf.navigation.AppPrivacyNoticePrompt
import org.jetbrains.kotlinconf.navigation.ScheduleScreen
Expand Down Expand Up @@ -100,7 +99,6 @@ fun MainScreen(
InfoScreen(
onAboutConf = { rootNavController.navigate(AboutConferenceScreen) },
onAboutApp = { rootNavController.navigate(AboutAppScreen) },
onNewsFeed = { rootNavController.navigate(NewsListScreen) },
onOurPartners = { rootNavController.navigate(PartnersScreen) },
onCodeOfConduct = { rootNavController.navigate(CodeOfConductScreen) },
onTwitter = { uriHandler.openUri(URLs.TWITTER) },
Expand Down
Loading