File tree Expand file tree Collapse file tree
api/src/main/java/com/getcode
app/src/main/java/com/getcode/inject Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com.getcode.annotations
2+
3+ import javax.inject.Qualifier
4+
5+ @Qualifier
6+ @Target(
7+ AnnotationTarget .FUNCTION ,
8+ AnnotationTarget .PROPERTY_GETTER ,
9+ AnnotationTarget .PROPERTY_SETTER ,
10+ AnnotationTarget .VALUE_PARAMETER ,
11+ AnnotationTarget .FIELD
12+ )
13+ annotation class DevManagedChannel
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ sealed interface MessageContent {
244244 @Deprecated(" Replaced with v2" )
245245 operator fun invoke (proto : Content ): MessageContent ? {
246246 return when (proto.typeCase) {
247- Content .TypeCase .SERVER_LOCALIZED -> Localized (proto.serverLocalized .keyOrText)
247+ Content .TypeCase .LOCALIZED -> Localized (proto.localized .keyOrText)
248248 Content .TypeCase .EXCHANGE_DATA -> {
249249 val verb = Verb (proto.exchangeData.verb)
250250 val messageStatus = if (verb.increasesBalance) MessageStatus .Incoming else MessageStatus .Delivered
Original file line number Diff line number Diff line change @@ -6,15 +6,12 @@ import com.getcode.network.core.GrpcApi
66import io.grpc.ManagedChannel
77import io.grpc.stub.StreamObserver
88import javax.inject.Inject
9- import javax.inject.Named
109
1110class ChatApiV2 @Inject constructor(
12- @Named(" devManagedChannel" )
1311 managedChannel : ManagedChannel
1412) : GrpcApi(managedChannel) {
1513 private val api = ChatGrpc .newStub(managedChannel)
1614
17-
1815 fun streamChatEvents (
1916 observer : StreamObserver <ChatService .StreamChatEventsResponse >
2017 ): StreamObserver <ChatService .StreamChatEventsRequest >? {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.content.Context
44import com.getcode.BuildConfig
55import com.getcode.R
66import com.getcode.analytics.AnalyticsService
7+ import com.getcode.annotations.DevManagedChannel
78import com.getcode.manager.MnemonicManager
89import com.getcode.model.CurrencyCode
910import com.getcode.model.PrefsString
@@ -82,7 +83,7 @@ object ApiModule {
8283
8384 @Singleton
8485 @Provides
85- @Named( " devManagedChannel " )
86+ @DevManagedChannel
8687 fun provideDevManagedChannel (@ApplicationContext context : Context ): ManagedChannel {
8788 val TLS_PORT = 443
8889 val DEV_URL = " api.codeinfra.dev"
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ message ChatMessageId {
128128message Pointer {
129129 Kind kind = 1 ;
130130 enum Kind {
131- UNKNOWN = 0 ;
132- READ = 1 ;
131+ UNKNOWN = 0 ;
132+ READ = 1 ;
133133 }
134134
135135 ChatMessageId value = 2 ;
@@ -141,7 +141,7 @@ message ChatMetadata {
141141 oneof title {
142142
143143 LocalizedContent localized = 2 ;
144- common.v1.Domain domain = 3 ;
144+ common.v1.Domain domain = 3 ;
145145 }
146146
147147 // Pointer in the chat indicating the most recently read message by the user
@@ -179,9 +179,9 @@ message ChatMessage {
179179message Content {
180180 oneof type {
181181
182- LocalizedContent server_localized = 1 ;
183- ExchangeDataContent exchange_data = 2 ;
184- NaclBoxEncryptedContent nacl_box = 3 ;
182+ LocalizedContent localized = 1 ;
183+ ExchangeDataContent exchange_data = 2 ;
184+ NaclBoxEncryptedContent nacl_box = 3 ;
185185 }
186186
187187}
@@ -227,5 +227,4 @@ message NaclBoxEncryptedContent {
227227// strategies evolve.
228228message Cursor {
229229 bytes value = 1 ;
230- }
231-
230+ }
You can’t perform that action at this time.
0 commit comments