Repository navigation
Bridge GroupMe voice notes #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
feb1fd2
Describe GroupMe images and hide media URLs GroupMe adds to text
iFixRobots 8cad42b
Bridge GroupMe voice notes
iFixRobots b8850d0
Strip every trailing media URL and keep DM document notices
iFixRobots 0358ebf
Merge branch 'iFixRobots/media-info' into iFixRobots/voice-notes
iFixRobots a95aedc
Keep sub-second voice notes' duration
iFixRobots 6f39803
Never match an empty media URL
iFixRobots 50f47e7
Merge branch 'iFixRobots/media-info' into iFixRobots/voice-notes
iFixRobots f03799f
Merge remote-tracking branch 'origin/main' into iFixRobots/voice-notes
iFixRobots 322d2bf
Merge remote-tracking branch 'origin/main' into iFixRobots/voice-notes
iFixRobots 00d3ac6
Decode comma-separated voice peaks from live DMs
Fizzadar 075d182
Group test imports for goimports
iFixRobots File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package connector | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "slices" | ||
| "testing" | ||
|
|
||
| "maunium.net/go/mautrix/event" | ||
|
|
||
| "github.com/beeper/groupme-lib" | ||
| ) | ||
|
|
||
| func TestVoiceNoteNativePeakFormats(t *testing.T) { | ||
| for name, peaks := range map[string]string{ | ||
| "array": `[0,0.125,0.5,1,0]`, | ||
| "group string": `"[0,0.125,0.5,1,0]"`, | ||
| "live DM string": `"0.0,0.125,0.5,1.0,0.0"`, | ||
| } { | ||
| t.Run(name, func(t *testing.T) { | ||
| content := &event.MessageEventContent{} | ||
| addVoiceNoteInfo(content, &groupme.Attachment{ | ||
| Type: groupme.Audio, Duration: 3, Peaks: json.RawMessage(peaks), | ||
| }) | ||
| if content.MSC3245Voice == nil || content.Info.Duration != 3000 || content.MSC1767Audio.Duration != 3000 { | ||
| t.Fatal("voice flag or duration missing") | ||
| } | ||
| if !slices.Equal(content.MSC1767Audio.Waveform, []int{0, 128, 512, 1024, 0}) { | ||
| t.Fatalf("unexpected waveform: %v", content.MSC1767Audio.Waveform) | ||
| } | ||
| }) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.