Skip to content
This repository has been archived by the owner on Mar 18, 2020. It is now read-only.

Commit

Permalink
add new Is* event fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Cooper committed Dec 11, 2014
1 parent 84f17b2 commit 1c9b1e5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,22 @@ Note: events with a `Type` field have slight changes than what is documented in
- `IsDisconnected`
- `IsKicked`
- `IsBanned`
- `IsRegistered`
- `IsUnregistered`
- `IsChangeName`
- `IsChangeChannel`
- `IsChangeComment`
- `IsChangeAudio`
- `IsChangeTexture`
- `IsChangePrioritySpeaker`
- `IsChangeRecording`
- `ChannelChangeEvent`
- `IsCreated`
- `IsRemoved`
- `IsMoved`
- `IsChangeName`
- `IsChangeDescription`
- `IsChangePosition`
- `PermissionDeniedEvent`
- `IsOther`
- `IsPermission`
Expand Down
21 changes: 14 additions & 7 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ func (in *Instance) OnUserChange(e *gumble.UserChangeEvent) {

String: e.String,

IsConnected: e.Type.Has(gumble.UserChangeConnected),
IsDisconnected: e.Type.Has(gumble.UserChangeDisconnected),
IsKicked: e.Type.Has(gumble.UserChangeKicked),
IsBanned: e.Type.Has(gumble.UserChangeBanned),
IsChangeName: e.Type.Has(gumble.UserChangeName),
IsChangeChannel: e.Type.Has(gumble.UserChangeChannel),
IsChangeComment: e.Type.Has(gumble.UserChangeComment),
IsConnected: e.Type.Has(gumble.UserChangeConnected),
IsDisconnected: e.Type.Has(gumble.UserChangeDisconnected),
IsKicked: e.Type.Has(gumble.UserChangeKicked),
IsBanned: e.Type.Has(gumble.UserChangeBanned),
IsRegistered: e.Type.Has(gumble.UserChangeRegistered),
IsUnregistered: e.Type.Has(gumble.UserChangeUnregistered),
IsChangeName: e.Type.Has(gumble.UserChangeName),
IsChangeChannel: e.Type.Has(gumble.UserChangeChannel),
IsChangeComment: e.Type.Has(gumble.UserChangeComment),
IsChangeAudio: e.Type.Has(gumble.UserChangeAudio),
IsChangeTexture: e.Type.Has(gumble.UserChangeTexture),
IsChangePrioritySpeaker: e.Type.Has(gumble.UserChangePrioritySpeaker),
IsChangeRecording: e.Type.Has(gumble.UserChangeRecording),
}

if event.IsConnected {
Expand All @@ -95,6 +101,7 @@ func (in *Instance) OnChannelChange(e *gumble.ChannelChangeEvent) {
IsMoved: e.Type.Has(gumble.ChannelChangeMoved),
IsChangeName: e.Type.Has(gumble.ChannelChangeName),
IsChangeDescription: e.Type.Has(gumble.ChannelChangeDescription),
IsChangePosition: e.Type.Has(gumble.ChannelChangePosition),
}

for _, listener := range in.listeners["channelchange"] {
Expand Down
21 changes: 14 additions & 7 deletions wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,19 @@ type userChangeEventWrapper struct {

String string

IsConnected bool
IsDisconnected bool
IsKicked bool
IsBanned bool
IsChangeName bool
IsChangeChannel bool
IsChangeComment bool
IsConnected bool
IsDisconnected bool
IsKicked bool
IsBanned bool
IsRegistered bool
IsUnregistered bool
IsChangeName bool
IsChangeChannel bool
IsChangeComment bool
IsChangeAudio bool
IsChangeTexture bool
IsChangePrioritySpeaker bool
IsChangeRecording bool
}

type channelChangeEventWrapper struct {
Expand All @@ -93,6 +99,7 @@ type channelChangeEventWrapper struct {
IsMoved bool
IsChangeName bool
IsChangeDescription bool
IsChangePosition bool
}

type permissionDeniedEventWrapper struct {
Expand Down

0 comments on commit 1c9b1e5

Please sign in to comment.