Update pnut library to include api fixes and include embedded links #2
3 changed files with 11 additions and 12 deletions
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Morgan McMillian
|
||||
Copyright (c) 2023 Morgan McMillian
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
11
README.md
11
README.md
|
@ -2,20 +2,13 @@
|
|||
|
||||
A [matterbridge] API plugin allowing you to connect message channels on [pnut.io] to other supported chat services.
|
||||
|
||||
## Contributing
|
||||
|
||||
Report bugs or submit patches via [email].
|
||||
|
||||
Join my public chat room for development discussion.
|
||||
|
||||
- [#devel:mcmillian.ems.host]
|
||||
|
||||
## License
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Morgan McMillian
|
||||
Copyright (c) 2023 Morgan McMillian
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -38,5 +31,3 @@ SOFTWARE.
|
|||
|
||||
[matterbridge]: https://github.com/42wim/matterbridge
|
||||
[pnut.io]: https://pnut.io
|
||||
[email]: https://morgan.mcmillian.dev/contact
|
||||
[#devel:mcmillian.ems.host]: https://matrix.to/#/#devel:mcmillian.ems.host
|
||||
|
|
|
@ -176,9 +176,17 @@ func pnutMsgHandler(conf *Config, msg woodstock.Message) {
|
|||
if msg.User.Username == conf.PnutUsername {
|
||||
return
|
||||
}
|
||||
msgtext := msg.Content.Text
|
||||
linktext := ""
|
||||
for _, v := range msg.Content.Entities.Links {
|
||||
linktext = "| " + linktext + v.URL + "\n"
|
||||
}
|
||||
if len(linktext) > 0 {
|
||||
msgtext = msgtext + "\n\n" + linktext
|
||||
}
|
||||
log.Printf(">> sending message from channel %s to %s ...", msg.ChannelID, gateway)
|
||||
data := MbOutMsg{
|
||||
Text: msg.Content.Text,
|
||||
Text: msgtext,
|
||||
Username: msg.User.Username,
|
||||
Gateway: gateway,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue