Merge pull request #29 from status-im/fix/issue-2996

fix(@desktop/general): clicking push notification does expand the app but does not open correct channel/chat
This commit is contained in:
Iuri Matias 2021-09-06 15:08:56 -04:00 committed by GitHub
commit f2f8f3a9e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 5 deletions

View File

@ -34,6 +34,7 @@ include "nimqml/private/qdeclarative.nim"
include "nimqml/private/nimqmlmacros.nim"
include "nimqml/private/singleinstance.nim"
include "nimqml/private/status/statusevent.nim"
include "nimqml/private/status/statusosnotification.nim"
proc signal_handler*(receiver: pointer, signal: cstring, slot: cstring) =

View File

@ -33,6 +33,7 @@ type
DosQAbstractTableModel = distinct pointer
DosQAbstractListModel = distinct pointer
DosStatusEventObject = distinct pointer
DosStatusOSNotificationObject = DosQObject
DosParameterDefinition = object
name: cstring
@ -345,3 +346,12 @@ proc dos_singleinstance_delete(vptr: DosQObject) {.cdecl, dynlib: dynLibName, im
proc dos_statusevent_create_showAppEvent(engine: DosQQmlApplicationEngine): DosStatusEventObject {.cdecl, dynlib: dynLibName, importc.}
proc dos_statusevent_create_osThemeEvent(engine: DosQQmlApplicationEngine): DosStatusEventObject {.cdecl, dynlib: dynLibName, importc.}
proc dos_statusevent_delete(vptr: DosStatusEventObject) {.cdecl, dynlib: dynLibName, importc.}
# DosStatusOSNotificationObject
proc dos_statusosnotification_create(): DosStatusOSNotificationObject
{.cdecl, dynlib: dynLibName, importc.}
proc dos_statusosnotification_show_notification(vptr: DosStatusOSNotificationObject,
title: cstring, messsage: cstring, identifier: cstring)
{.cdecl, dynlib: dynLibName, importc.}
proc dos_statusosnotification_delete(vptr: DosStatusOSNotificationObject)
{.cdecl, dynlib: dynLibName, importc.}

View File

@ -136,5 +136,7 @@ type
## A StatusEventObject
vptr: DosStatusEventObject
StatusOSNotificationObject* = ref object of QObject
const
UserRole* = 0x100

View File

@ -1,10 +1,8 @@
#import ../[nimqmltypes, dotherside]
proc setupDockShowAppEventObject*(self: StatusEventObject, engine: QQmlApplicationEngine) =
proc setupDockShowAppEventObject(self: StatusEventObject, engine: QQmlApplicationEngine) =
self.vptr = dos_statusevent_create_showAppEvent(engine.vptr)
proc setupOSThemeEventObject*(self: StatusEventObject, engine: QQmlApplicationEngine) =
proc setupOSThemeEventObject(self: StatusEventObject, engine: QQmlApplicationEngine) =
self.vptr = dos_statusevent_create_osThemeEvent(engine.vptr)
proc delete*(self: StatusEventObject) =

View File

@ -0,0 +1,14 @@
proc setup(self: StatusOSNotificationObject) =
self.vptr = dos_statusosnotification_create()
proc delete*(self: StatusOSNotificationObject) =
dos_statusosnotification_delete(self.vptr)
self.vptr.resetToNil
proc newStatusOSNotificationObject*(): StatusOSNotificationObject =
new(result, delete)
result.setup()
proc showNotification*(self: StatusOSNotificationObject, title: string,
message: string, identifier: string) =
dos_statusosnotification_show_notification(self.vptr, title, message, identifier)