Skip to content

Commit cd8fa7f

Browse files
committed
update to new core API 2.14.0
1 parent 8416e45 commit cd8fa7f

File tree

5 files changed

+6
-52
lines changed

5 files changed

+6
-52
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ way to do that is with Docker:
117117

118118
```
119119
$ docker pull ghcr.io/deltachat/mail-server-tester:release
120-
$ docker run -it --rm -p 3025:25 -p 3110:110 -p 3143:143 -p 3465:465 -p 3993:993 ghcr.io/deltachat/mail-server-tester
120+
$ docker run -it --rm -p 3025:25 -p 3110:110 -p 3143:143 -p 3465:465 -p 3993:993 ghcr.io/deltachat/mail-server-tester:release
121121
```
122122

123123
### Using AcFactory

deltachat/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const (
7373
MsgFile MsgType = "File"
7474
MsgVideochatInvitation MsgType = "VideochatInvitation"
7575
MsgWebxdc MsgType = "Webxdc"
76+
MsgVcard MsgType = "Vcard"
7677

7778
//System message types
7879
SysmsgUnknown SysmsgType = "Unknown"

deltachat/event.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (eventData *_EventData) ToEvent() Event {
101101
case eventTypeIncomingMsg:
102102
event = EventIncomingMsg{ChatId: eventData.ChatId, MsgId: eventData.MsgId}
103103
case eventTypeIncomingMsgBunch:
104-
event = EventIncomingMsgBunch{MsgIds: eventData.MsgIds}
104+
event = EventIncomingMsgBunch{}
105105
case eventTypeMsgsNoticed:
106106
event = EventMsgsNoticed{ChatId: eventData.ChatId}
107107
case eventTypeMsgDelivered:
@@ -346,7 +346,6 @@ func (event EventIncomingMsg) eventType() eventType {
346346
//
347347
// msg_ids contains the message ids.
348348
type EventIncomingMsgBunch struct {
349-
MsgIds []MsgId
350349
}
351350

352351
func (event EventIncomingMsgBunch) eventType() eventType {

deltachat/rpc.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,6 @@ func (rpc *Rpc) StopOngoingProcess(accountId AccountId) error {
171171
return rpc.Transport.Call(rpc.Context, "stop_ongoing_process", accountId)
172172
}
173173

174-
// Export public and private keys to the specified directory.
175-
// Note that the account does not have to be started.
176-
func (rpc *Rpc) ExportSelfKeys(accountId AccountId, path string) error {
177-
return rpc.Transport.Call(rpc.Context, "export_self_keys", accountId, path, nil)
178-
}
179-
180-
// Import private keys found in the specified directory.
181-
func (rpc *Rpc) ImportSelfKeys(accountId AccountId, path string) error {
182-
return rpc.Transport.Call(rpc.Context, "import_self_keys", accountId, path, nil)
183-
}
184-
185174
// Returns the message IDs of all fresh messages of any chat.
186175
// Typically used for implementing notification summaries
187176
// or badge counters e.g. on the app icon.
@@ -935,12 +924,6 @@ func (rpc *Rpc) GetDraft(accountId AccountId, chatId ChatId) (option.Option[MsgS
935924
return msg, err
936925
}
937926

938-
func (rpc *Rpc) SendVideoChatInvitation(accountId AccountId, chatId ChatId) (MsgId, error) {
939-
var id MsgId
940-
err := rpc.Transport.CallResult(rpc.Context, &id, "send_videochat_invitation", accountId, chatId)
941-
return id, err
942-
}
943-
944927
// ---------------------------------------------
945928
// misc prototyping functions
946929
// that might get removed later again
@@ -963,8 +946,8 @@ func (rpc *Rpc) MiscSendTextMessage(accountId AccountId, chatId ChatId, text str
963946
// the better version should support:
964947
// - changing viewtype to enable/disable compression
965948
// - keeping same message id as long as attachment does not change for webxdc messages
966-
func (rpc *Rpc) MiscSetDraft(accountId AccountId, chatId ChatId, text option.Option[string], file option.Option[string], quotedMessageId option.Option[MsgId], viewType option.Option[MsgType]) error {
967-
return rpc.Transport.Call(rpc.Context, "misc_set_draft", accountId, chatId, text, file, quotedMessageId, viewType)
949+
func (rpc *Rpc) MiscSetDraft(accountId AccountId, chatId ChatId, text option.Option[string], file option.Option[string], filename option.Option[string], quotedMessageId option.Option[MsgId], viewType option.Option[MsgType]) error {
950+
return rpc.Transport.Call(rpc.Context, "misc_set_draft", accountId, chatId, text, file, filename, quotedMessageId, viewType)
968951
}
969952

970953
// send the chat's current set draft

deltachat/rpc_test.go

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestRpc_MiscSetDraft_and_MiscSendDraft(t *testing.T) {
2525
acfactory.WithOnlineAccount(func(rpc *Rpc, accId AccountId) {
2626
chatId, err := rpc.CreateGroupChat(accId, "test group", true)
2727
require.Nil(t, err)
28-
err = rpc.MiscSetDraft(accId, chatId, option.Some("test"), option.None[string](), option.None[MsgId](), option.None[MsgType]())
28+
err = rpc.MiscSetDraft(accId, chatId, option.Some("test"), option.None[string](), option.None[string](), option.None[MsgId](), option.None[MsgType]())
2929
require.Nil(t, err)
3030
_, err = rpc.MiscSendDraft(accId, chatId)
3131
require.Nil(t, err)
@@ -174,19 +174,9 @@ func TestAccount_Contacts(t *testing.T) {
174174
assert.Nil(t, err)
175175
assert.Empty(t, ids)
176176

177-
contactId, err := rpc.CreateContact(accId, "null@localhost", "test")
178-
assert.Nil(t, err)
179-
180-
ids, err = rpc.GetContactIds(accId, 0, option.None[string]())
181-
assert.Nil(t, err)
182-
assert.Contains(t, ids, contactId)
183-
184177
ids, err = rpc.GetContactIds(accId, 0, option.Some("unknown"))
185178
assert.Nil(t, err)
186179
assert.Empty(t, ids)
187-
ids, err = rpc.GetContactIds(accId, 0, option.Some("test"))
188-
assert.Nil(t, err)
189-
assert.Contains(t, ids, contactId)
190180
})
191181
}
192182

@@ -260,15 +250,6 @@ func TestAccount_QrCode(t *testing.T) {
260250
})
261251
}
262252

263-
func TestAccount_ImportSelfKeys(t *testing.T) {
264-
t.Parallel()
265-
acfactory.WithOnlineAccount(func(rpc *Rpc, accId AccountId) {
266-
dir := acfactory.MkdirTemp()
267-
assert.Nil(t, rpc.ExportSelfKeys(accId, dir))
268-
assert.Nil(t, rpc.ImportSelfKeys(accId, dir))
269-
})
270-
}
271-
272253
func TestAccount_ImportBackup(t *testing.T) {
273254
t.Parallel()
274255
var backup string
@@ -481,12 +462,6 @@ func TestChat_Groups(t *testing.T) {
481462
assert.Nil(t, rpc.SetChatProfileImage(accId, chatId, option.None[string]()))
482463
assert.Nil(t, rpc.SetChatName(accId, chatId, "new name"))
483464

484-
contactId, err := rpc.CreateContact(accId, "null@localhost", "test")
485-
assert.Nil(t, err)
486-
assert.Nil(t, rpc.AddContactToChat(accId, chatId, contactId))
487-
488-
assert.Nil(t, rpc.RemoveContactFromChat(accId, chatId, contactId))
489-
490465
_, err = rpc.GetChatContacts(accId, chatId)
491466
assert.Nil(t, err)
492467

@@ -497,9 +472,5 @@ func TestChat_Groups(t *testing.T) {
497472

498473
_, err = rpc.SendMsg(accId, chatId, MsgData{Text: "test message"})
499474
assert.Nil(t, err)
500-
501-
assert.Nil(t, rpc.SetConfig(accId, "webrtc_instance", option.Some("https://test.example.com")))
502-
_, err = rpc.SendVideoChatInvitation(accId, chatId)
503-
assert.Nil(t, err)
504475
})
505476
}

0 commit comments

Comments
 (0)